flock filehandle, operation
Establishes or removes a lock on a file opened with filehandle.
This function calls one of the Unix functions
lockf, or the
locking capabilities of
fcntl, whichever your system supports. If
none of these functions exist on your system,
flock will produce
a fatal error.
operation is the type of locking function to perform.
The number by each operation name is the argument that Perl's
takes by default. You may also use the operation names if you explicitly
import them from the Fcntl module with
use Fcntl ":flock".
Establishes a shared lock on the file (read lock).
Establishes an exclusive lock on the file (write lock).
Removes a lock from the file.
flock from blocking while trying to
establish a lock with
instructs it to return
LOCK_NB must be ored with the other
operation as an expression for the operation argument, i.e.,
(LOCK_EX | LOCK_NB).