Hi

,
i have been trying to find/write a script that could do the following:
check a file lock: (file is locked and can't be edited)
if file is locked -> find the process(es) that is using/locking the file->print the list of processes to a log file.
if the file is not locked -> do nothing...
i found this module File::TinyLock
http://search.cpan.org/src/JKISTER/File-TinyLock-0.11/TinyLock.pm and has 3 subroutines(lock, unlock, and check) but it seems that it will only work for unix since it uses cmd "ps -p" ... i am trying to modify it to use "tasklist" which works for windows 2003, but no luck so far...
the reason i need this, is because sometimes our deployment fails because a file is locked for more than 10 mins ... it happens on random intervals ( every month or other month/week... ) and it is always random file which gets locked... so my idea is to monitor a file for 24 hours or more to just find a list of applications which lock our files, and from there i can guess which process that is causing this issue, and i might be able to plan the deployment around that...
there are few tools to find what is locking a file, like wholockme and whoslocking, but those are good to use manually since they send the output to a graphic window... i need a script that can write to a log...
while i am working on this

i hope that somebody on here already has something that i can use

or maybe more ideas.
this is for windows 2003/