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

Arnold Krille arnold at arnoldarts.de
Mon Dec 29 23:16:10 CET 2008


On Monday 29 December 2008 20:49:03 Stephan Rose wrote:
> If you were to create a temporary file that is an image and the happen
> to have the same directory open in explorer, when the file is created
> explorer will go and thumbnail it. If at that same moment the app tries
> to move the file it will fail due the fact that the file is currently
> being accessed by explorer.

I don't really know how broken the ms-filesystem is but on linux this is not a 
problem as the file stays present on disk until the last app closes it (in this 
case the thumbnail creator) but is inaccessible for new apps because the files 
reference is deleted from the directory tree. Afaik thats how it works on 
linux unless you "shred" a file (which is just an overwrite with random numbers 
before deleting it the standard-way).
And as thumbnail generators are also watching directories for changes, they 
will notice when a file gets deleted and recreated.

And moving shouldn't be a problem as the thumbnail-generator has a handle 
after opening the file. And the handle is rather independent of the 
filename/filepath.

Have fun,

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081229/ea3f151e/attachment.bin 


More information about the Qt-interest-old mailing list