[Interest] QFile copy and sync/fsync

Duane duane.hebert at group-upc.com
Fri Jan 4 14:27:24 CET 2013


On 01/04/2013 08:06 AM, Mandeep Sandhu wrote:
>>
>> 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.


I agree but it would absolutely have to be a separate thread.  This is a 
controller and there are watchdogs to maintain.  I will do this as soon 
as possible but I was wondering about the behavior where it seems to 
buffer all of the actual file copies until done and then writes to disk.





More information about the Interest mailing list