FileUtils: add `write_file_atomically()`

This commit adds a function to atomically write files. For that it creates a TemporaryFile, writes the data to it, makes a hard link from the destination to the temporary file and unlink()s the temporary file.

(This will be thread safe only if the contents to be written to a given path match across threads.)

This function will help to address #13 (closed).

Edited by Santiago Gil

Merge request reports

Loading