On Tue, 9 Nov 2010 20:28:43 +0200 Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
With binary I/O we have fsync(), which really flushes the data. Even fflush() and fclose() are not guaranteed to do that.
Strange, why is that?
Well, g_file_set_contents() uses buffered I/O, so obviously it's acceptable too.
Yes, it uses fwrite and then errno.
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).
Nick