News for hackers. Stuff that matters.
Re:Comparative unsafety by rectang on Friday April 09, 2021 @05:54PM (#26756673)
My understanding is fsync() will tell you more than close() only when a flush of the OS cache fails to make it to disk. Is there anything else?

The problem with calling fsync() is that you have to wait for it to finish. There are many scenarios where the extra data integrity guarantees you get from calling fsync() aren't important.

Re:Comparative unsafety by ncmncm on Friday April 09, 2021 @09:53PM (#26758256)
close() will fail to report a wide variety of failures.

But Cesar is right, you can't re-try it. And fsync() can be very slow on most commonly-used file systems. We are fortunate that now SSDs are fast.