1. Perl
  2. Module
  3. here

Fcntl - Import constants for flock/seek/sysopen function

You can use the Fcntl function to import constants used in the flock and seek functions.

# constant of flock function
use Fcntl ':flock';

# seek function constant
use Fcntl ':seek';

# sysopen function constant
use Fcntl ':DEFAULT';

Constants used in the flock function

This is the constant used in the imported flock function.

LOCK_SH Read lock
LOCK_EX Write lock
LOCK_NB Non-blocking mode
LOCK_UN unlock

Constants used in the seek function

A constant used in the imported seek function.

SEEK_SET Top of file
SEEK_CUR present location
SEEK_END End of file

Constants used in sysopen function

This is a constant related to the file mode used by the imported sysopen function.

O_WRONLY write in
O_RDWR Read/write
O_CREAT Create the file if it does not exist.
O_EXCL Fail open if the file exists
O_APPEND Additional writing
O_TRUNC Truncate the file to 0 bytes

Related Informatrion