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

Yes, the code in the article will at one unlucky point end up with an empty file after a power outage.

At least write to a temp file(in the same filesystem), fsync the file and its folder and rename it over the original.



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

Search: