Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Flock, Seek & WinNT (not advisory)

by tye (Sage)
on Dec 30, 2002 at 19:08 UTC ( [id://223139] : note . print w/replies, xml ) Need Help??


in reply to Re: Flock, Seek & WinNT
in thread Flock, Seek & WinNT

Note that flock() under Win32 is more like the (non-default) mandatory locking in Unix than like regular advisory locking.

This means that having a lock on a file in Win32 can prevent other processes from reading from or writing to the file (I used to think it even prevented opening but my current testing says otherwise so this might depend on the version of Win32 or...).

What you might find even more surprising is that having a lock on one file handle can prevent the same process from reading from or writing to that file via a different file handle.

                - tye (you have been warned)
  • Comment on Re^2: Flock, Seek & WinNT (not advisory)