[Interest] QFile copy and sync/fsync

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Fri Jan 4 14:06:42 CET 2013


>
> What I don't understand is that if I mount the USB stick with sync, and
> I have a for loop that copies N files, after the for loop finishes,
> there is a long delay.  I can see from the led on the usb stick that
> this is when the files are being written.  Is this something that the OS
> (in this case Tiny Core Linux) decides to do or is there some way to
> change this behavior in Qt?

As others have suggested, why not show a dialog or some such to tell
the user that files are being written to the USB disk (and they should
not disconnect it till the op is over). Nautilus does this when you
try to unmount a drive while the files are being written to the drive.

You could also try moving the file writing to a different thread and
wait for it to complete in the main GUI thread if you dont want the
GUI to freeze.

HTH,
-mandeep

>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list