[Qt-interest] Writing file.

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Wed Apr 8 13:11:08 CEST 2009


Sujan Dasmahapatra wrote on Wednesday, April 08, 2009 1:00 PM:

> Thanks friends for the response.But I have written the code exactly
> like below.But its still not writing onto the file.

Also note that depending on the underlying file system the data might get buffered for a long time, until it is actually written onto the harddisk!

You could call flush() (or whatever the Qt API equivalent is), as to enforce the write, but that is usually a performance killer (there is a reason why the OS buffers IO ;)

But for sure calling close() is necessary. If you don't, that is considered a "resources leak" in your app.

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list