[Qt-interest] How to wait <N> ms for file creation/deletion to succeed?
Thiago Macieira
thiago.macieira at trolltech.com
Mon Dec 29 17:17:07 CET 2008
Robert Hairgrove wrote:
>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).
Hi Robert,
Where are you seeing such situations?
Local file operations are supposed to finish before the system call
returns. So, by the time that your program regains control, the file has
already been renamed or removed.
--
Thiago Macieira - thiago.macieira (AT) nokia.com
Senior Software Engineer - Nokia, Qt Software
Qt Software is hiring - ask me
Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081229/4253f524/attachment.bin
More information about the Qt-interest-old
mailing list