in reply to Detecting locked files in Windows

Try to see if you can take a lock on it. If you can't, it's locked.
use Fcntl ':flock'; if ( flock( $filename, LOCK_EX | LOCK_NB ) ) { # File is unlocked flock( $filename, LOCK_UN ); } else { # File is locked. }

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?