http://www.perlmonks.org?node_id=471498


in reply to Re^3: Writing to a file atomically without renaming
in thread Writing to a file atomically without renaming

no. worse case is when you are "rolling back" that another user on your multi user system steals the disk space needed for the cat backupfile > file between the time the > zeros file out and the time cat is done -- leaving you with a broken file. That is why the unlink,rename method is popular -- at no time do you destroy the rollback until the new file is in place.


-Waswas