Programming Perl

Programming PerlSearch this book
Previous: 7.2.25 ExtUtils::MM_VMS - Methods to Override UNIX Behavior in ExtUtils::MakeMakerChapter 7
The Standard Perl Library
Next: 7.2.27 File::Basename - Parse File Specifications
 

7.2.26 Fcntl - Load the C fcntl.h Defines

use Fcntl;

$nonblock_flag = O_NDELAY();
$create_flag = O_CREAT();
$read_write_flag = O_RDWR();

This module is just a translation of the C fcntl.h file. Unlike the old mechanism which required a translated fcntl.ph file, fcntl uses the h2xs program (see the Perl source distribution) and your native C compiler. This means that it has a much better chance of getting the numbers right.

Note that only #define symbols get translated; you must still correctly pack up your own arguments to pass as arguments for locking functions and so on.

The following routines are exported by default, and each routine returns the value of the #define that is the same as the routine name:

FD_CLOEXECF_DUPFDF_GETFDF_GETFLF_GETLKF_RDLCK
F_SETFDF_SETFLF_SETLKF_SETLKWF_UNLCKF_WRLCK
O_APPENDO_CREATO_EXCLO_NDELAYO_NOCTTY
O_NONBLOCKO_RDONLYO_RDWRO_TRUNCO_WRONLY


Previous: 7.2.25 ExtUtils::MM_VMS - Methods to Override UNIX Behavior in ExtUtils::MakeMakerProgramming PerlNext: 7.2.27 File::Basename - Parse File Specifications
7.2.25 ExtUtils::MM_VMS - Methods to Override UNIX Behavior in ExtUtils::MakeMakerBook Index7.2.27 File::Basename - Parse File Specifications