Why Can't I Delete a File I Created with Win XP?

Dave Angel davea at ieee.org
Sun Dec 6 17:12:23 EST 2009


Hans Mulder wrote:
> <div class="moz-text-flowed" style="font-family: -moz-fixed">J wrote:
>
>> But that being said, this brings to mind a question about this...  in
>> *nix, when I can't do something like delete a file or directory, or
>> unmount a filesystem and cant find the cause, I can do an lsof and
>> grep for references to the file/directory in question, then work from
>> there to close anything that still has a lock.
>
> It's been a while since a last had this problem.  I found a program
> named "handle.exe" somewhere on microsoft.com.  It spits out a listing
> showing which process has which files open.  You can kill the offending
> processes, and then you can delete your file.
>
> I suppose Google can help you find this program.
>
>
> Hope this helps,
>
> -- HansM
>
>
Handle.exe and "Process Explorer" (mentioned by J) are both from 
Sysinternals, which was acquired by Microsoft, and to be found on their 
site.

http://technet.microsoft.com/en-us/sysinternals/default.aspx

http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx    for handle.exe
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx   for process explorer

But as long as I'm in the thread, I'll state that I suspect the problem to be simply that the OP is running his script inside some IDE, and it hasn't really ended.  So the first thing I'd try is to exit the IDE, and see whether the file is then released.

DaveA




More information about the Python-list mailing list