The standard technique for writing files safely on Unix are presumably well known: you write to a temporary file alongside your target and then, when you’re finished, rename the temporary file into place. Writing code to do this is pretty straightforward, but it’s also rather dull and exactly the sort of thing which ought to be automated.
Continue reading Safely writing files.