qt-interest@trolltech.com
[Top] [All Lists]

Re: [Qt-interest] How to wait <N> ms for file creation/deletion to succe

Subject: Re: [Qt-interest] How to wait <N> ms for file creation/deletion to succeed?
From: Thiago Macieira
Date: Mon, 29 Dec 2008 14:17:07 -0200
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
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest
<Prev in Thread] Current Thread [Next in Thread>