[Python-Dev] Coernic Desktop Search versus shutil.rmtree

Aahz aahz at pythoncraft.com
Fri Sep 3 02:11:01 CEST 2004


On Thu, Sep 02, 2004, Tim Peters wrote:
>
> [Tim]
>>> The cause:  Windows has low-level hooks for apps that want to
>>> monitor changes to the filesystem.  For example, virus scanners
>>> use those heavily.  Coernic also uses them, to reindex changed
>>> files in the background.  So it can keep a file open beyond the time
>>> Python thinks it deleted it, and then trying to rmdir its parent
>>> directory fails (because the directory isn't really empty yet).
> 
> [Aahz]
>> What happens when you use Windows Exploder to delete the folder?
> 
> I didn't try Explorer specifically.  Since I was in a DOS box anyway,
> I used rmdir/s to clean it out.  I'm sure using Explorer would have
> worked too.
> 
> This is a timing problem.  By the time I can click on the folder to
> delete it in Explorer, or by the time I can type "rmdir/s xx",
> Copernic is long done reindexing the files, so there's no problem
> nuking the directory then.  shutil.rmtree issues the rmdir at machine
> speed.

Question is, what happens when you use Explorer while Coernic is busy
inside a folder?  If it barfs, then I think it's reasonable for rmtree()
to barf.  Or are you saying that it's not possible to make that test?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I saw `cout' being shifted "Hello world" times to the left and stopped
right there."  --Steve Gonedes


More information about the Python-Dev mailing list