Archive: How can I check directory for locked files?


How can I check directory for locked files?
How can I recursively check if a directory contains write-locked files (running .exe or .dll)?

I'm writing an updater that simply replaces old filed with new ones and before starting the update process I want to check if it is safe. Without this check I may end up with half-updated application (some dll updates may succeed before I encounter running exe and than user may close the updater) which will be unusable.


You can use the LockedList plug-in to test individual files. It also has a IsFileLocked function for silently checking individual files if you want to do it yourself (i.e. in a loop with FindFirst, FindNext etc.).

Stu