(Winows) Finding out which process has locked a file.

CinnamonDonkey CinnamonDonkey at googlemail.com
Wed May 13 11:20:46 CEST 2009


Hi all,

Does anyone know how I can programatically find out which process
(resolved to human friendly string, i.e. executable) has a lock on a
file.

I have a script running which occassionally fails because it is trying
to delete a file in use by another process. When this happens I want
it to log which process has the lock.

Since it tends to happen when I am never near the computer to catch
it! :(

Cheers,
Shaun



More information about the Python-list mailing list