- Published on
Investigation · Part 3 of 20 · What survives a crash
How to Save a File Without Losing It: Write, fsync, Rename
I killed a program 300 times while it saved a file. Writing in place left a cut file 233 times, without any power loss. A temp file, fsync and rename never did. Then I traced how sed, Python, cp, install and git save files.