logoalt Hacker News

cozzyd • yesterday at 6:30 PM • 1 reply • view on HN

can't most applications ... write to a temp file and rename? Maybe that's not atomic on Widows?


Replies

dezgeg • yesterday at 6:51 PM

Using fsync() is still required to be correct in power-loss situation, as the filesystem can otherwise reorder the rename to happen before the temp file contents are persisted. It's harder problem than one'd think.

➕ show 1 reply