in reply to Re^2: TIMTOWTDI Challenge: Open a file
in thread TIMTOWTDI Challenge: Open a file

Windows supports both advisory and mandatory file locking, and can perform a non-blocking lock check.

It even uses mandatory exclusive locks by default. You can relax the lock and allow others to do any combination of the following: delete the file (FILE_SHARE_DELETE), read from the file (FILE_SHARE_READ) and write to the file (FILE_SHARE_WRITE).

Finally, Perl's flock works perfectly fine in Windows, including LOCK_NB.