I would like to know who is locking a file (win32). I know about WhoLockMe, but I would like a command-line tool which does more or less the same thing.
I also looked at this question, but it seems only applicable for files opened remotely.
Using Resource Monitor, you can identify the process or service locking a file. It is an inbuilt utility in Windows 10 that helps you monitor CPU usage, memory, disk network, file handles, etc. Open Run app by pressing Windows + R hotkey and then type resmon in it. Press the OK button and Resource Monitor will open up.
lsof can help to see the list of file. here is way to see the locked files. Show activity on this post. in case lsof itself is missing on the system, ls /proc/*/fd/* | grep LOCK_FILE_NAME should provide the same information.
Handle should do the trick.
Ever wondered which program has a particular file or directory open? Now you can find out. Handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With