On Wed, 10 Nov 2010 13:25:56 +0000 Nick Treleaven nick.treleaven@btinternet.com wrote:
But since we don't write the file line-by-line or something, _why_ do we use buffered I/O in the first place?..
I don't know. But changing implementation often introduces bugs, so I'm reluctant to do so (besides fixing fclose failure).
Well the current implementation is not exactly bug-free. :)
OK, so we do need a fix so that failed writing is reported to the user, can't rely on errno.
I've now committed a fix so that any write failure should be reported to the user even if errno is 0. Please test.
fclose check is fixed now too.
I decided to stay with buffered I/O as that may be more portable.
Nick