News for hackers. Stuff that matters.
Re:Show HN: AtomicWrite: cross platform library for atomical... by agwa on Tuesday March 13, 2018 @12:08PM (#16577246)
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.

Re:Show HN: AtomicWrite: cross platform library for atomical... by jeffreyrogers on Tuesday March 13, 2018 @05:34PM (#16580032)
Thanks, you're right. I'll fix this.