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

This code is buggy because it assumes that a single write() will write out the entire file:

https://gitlab.com/jeffreyrogers27/AtomicWrite/blob/8a40d050...

In reality, write() may write a partial amount, so you need to loop and call write() again until the entire file has been written or write() returns an error.




Thanks, you're right. I'll fix this.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: