[Qt-interest] Writing file.
Sean Harmer
sean.harmer at maps-technology.com
Wed Apr 8 15:15:24 CEST 2009
On Wednesday 08 April 2009 13:49:59 Oliver.Knoll at comit.ch wrote:
> But back to the original question: even if you call close() this (probably)
> does *not* imply a flush(). close() merely gives the file descriptor "back
> to the OS" (which *might* off course influence the caching/writing, since
> the I/O module of the OS now knows that no one is going to write anything
> more into that file - at least not this process which just closed the
> file). In other words, depending on the caching strategy (and other write()
> operations) it might still take some while until the bytes finally arrive
> physically on the disk!
>
> For example the Ext4 file system caches small writes up to one (!) minute
> (unless flush() is called). And even if you call flush(), there's still the
> physical harddisk controller cache... ;)
Also it is not clear that the OP even let the app run as far as destroying the
QFile object. He seemed to imply that he was only checking for file contents
on disk after the call:
out << "." << "\n";
He may well have killed the app at this point and so never have given the app
or OS the chance to cleanly flush their buffers.
Sean
More information about the Qt-interest-old
mailing list