[Qt-interest] How to wait <N> ms for file creation/deletion to succeed?

Robert Hairgrove evorgriahr at hispeed.ch
Mon Dec 29 16:22:05 CET 2008


What is the proper (i.e. platform-independent) way to sleep and poll for 
a file operation to finish?

I am encrypting/decrypting a file, writing the results to a temporary 
file, deleting the original file and renaming the temporary file to the 
one I just deleted. From past experience I know that timing sometimes 
causes trouble. For example, on Windows you can call the API function 
sleep(). There are some sleep() functions in QThread, but I think they 
are not accessible from outside the thread object's code (they are 
declared static protected).

Thanks!



More information about the Qt-interest-old mailing list