Write new file to a temporary directory and move it afterwards.
Local adjustments
Cleanup, local adjustments.
Write new file to a temporary directory and move it afterwards.