13 Mar 2022 08:40:18 UTC
- Distribution: perl
- Module version: 1.14
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (2152)
- KwaliteeBus factor: 15
- License: perl_5
- Download (17.35MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:211 non-PAUSE users
Fcntl - load the C Fcntl.h defines
use Fcntl; use Fcntl qw(:DEFAULT :flock);
This module is just a translation of the C fcntl.h file. Unlike the old mechanism of requiring a translated fcntl.ph file, this uses the h2xs program (see the Perl source distribution) and your native C compiler. This means that it has a far more likely chance of getting the numbers right.
#definesymbols get translated; you must still correctly pack up your own arguments to pass as args for locking functions, etc.
By default your system's F_* and O_* constants (eg, F_DUPFD and O_CREAT) and the FD_CLOEXEC constant are exported into your namespace.
You can request that the flock() constants (LOCK_SH, LOCK_EX, LOCK_NB and LOCK_UN) be provided by using the tag
:flock. See Exporter.
You can request that the old constants (FAPPEND, FASYNC, FCREAT, FDEFER, FEXCL, FNDELAY, FNONBLOCK, FSYNC, FTRUNC) be provided for compatibility reasons by using the tag
:Fcompat. For new applications the newer versions of these constants are suggested (O_APPEND, O_ASYNC, O_CREAT, O_DEFER, O_EXCL, O_NDELAY, O_NONBLOCK, O_SYNC, O_TRUNC).
For ease of use also the SEEK_* constants (for seek() and sysseek(), e.g. SEEK_END) and the S_I* constants (for chmod() and stat()) are available for import. They can be imported either separately or using the tags
Please refer to your native fcntl(2), open(2), fseek(3), lseek(2) (equal to Perl's seek() and sysseek(), respectively), and chmod(2) documentation to see what constants are implemented in your system.
See perlopentut to learn about the uses of the O_* constants with sysopen().
See "stat" in perlfunc about the S_I* constants.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|