Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Currently many people writes to a new file and `rename` into the old one to achieve the first kind of guarantee.


Linux has added "renameat()" and "renameat2()", which are supposed to be atomic if the system does not crash but are not guaranteed to recover cleanly. Some networked file systems (NFS, at least) can't do an atomic rename; if you lose the network connection during the switch you may be in an invalid state.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: