News for hackers. Stuff that matters.
Re:How to rewrite files in Linux by jws on Sunday March 08, 2009 @12:41PM (#507307)
guilty of #2. I'll spend part of this afternoon putting in fsyncs().

Pseudo related: I wish I could have anonymous temporary files and associate them with a name later. Temporary name handling is just bugs waiting to happen. Even if you do it securely, how many programmers have a way of cleaning up spurious debris that might be left after an inelegant termination?

Re:How to rewrite files in Linux by tptacek on Sunday March 08, 2009 @12:51PM (#507317)
You create secure temp files with mkstemp(). It's built into the standard C library.

Mad respect to Ts'o, but most Unix apps --- regardless of what he thinks of the developers --- don't do this fsync dance. There isn't an epidemic of corrupted files because of it. And there have been notable cases where syncing has caused calamitous performance problems; for instance, look up what the Apple developers did to sqlite.

Re:How to rewrite files in Linux by jws on Sunday March 08, 2009 @12:57PM (#507324)
The first application I went to fix is in PHP, there does not seem to be an fsync() call in PHP. I may not succeed this afternoon.