[Qt-interest] Antwort: Re: Writing file.

Sean Harmer sean.harmer at maps-technology.com
Wed Apr 8 13:51:41 CEST 2009


On Wednesday 08 April 2009 12:46:32 you wrote:
> qt-interest-bounces at trolltech.com schrieb am 08.04.2009 13:08:44:
> > Simply try closing
> > the file at the end of your function or call flush() to force the data
>
> to be
>
> > written to disk.
>
> Does a call to fflush() really ensure the data to be written to disk??? I
> think only the stream get's flushed, but whether the data gets written to
> the disk is up to the filesystem. In those cases you also need to perform
> a call to fsync().  Please correct me if I am wrong.
I believe that you are correct. I was merely thinking of the application level 
problem evident in the OP's code. What the OS then does with the data is 
another matter. The file may even reside on a remote filesystem (e.g. NFS, 
CIFS) so more than a simple fsync() may have to happen.


Cheers,

Sean




More information about the Qt-interest-old mailing list