On Thu, 15 Jan 2009, David Golden wrote:

> I've found that if I load my windows machine enough, I can cause rmtree to
> fail due to permissions -- usually because a file couldn't be deleted.  Best
> hypothesis is that it's due a virus scanner that is too slow due to the
> loading to check the file and get out of the way for deletion.

It could actually also happen if you are running some kind of indexing service,
like Windows Desktop Search etc.  They might also keep a file open while it
is being deleted.
 
> I'm open to suggestions.

You could create an additional single temp directory, redefine
CORE::GLOBAL::unlink() to rename() files into this directory (using
unique names) before unlink()ing them, and then remove this special temp
directory at the very end. If you can't remove that directory even after
a few retries, just leave it behind and don't signal a failure.

At least you only end up with a single point where you have to wait
so you could afford more and longer timeouts until you give up.

Well, it's a suggestion, not necessarily a good one though...

Cheers,
-Jan

Reply via email to