Package Info

perl-File-FcntlLock


File locking with L<fcntl(2)>


Development/Libraries/Perl

File locking in Perl is usually done using the 'flock' function. Unfortunately, this only allows locks on whole files and is often implemented in terms of the the flock(2) manpage system function which has some shortcomings (especially concerning locks on remotely mounted file systems) and slightly different behaviour than the fcntl(2) manpage.

Using this module file locking via the fcntl(2) manpage can be done (obviously, this restricts the use of the module to systems that have a the fcntl(2) manpage system call). Before a file (or parts of a file) can be locked, an object simulating a flock structure, containing information in a binary format to be passed to the fcntl(2) manpage for locking requests, must be created and its properties set. Afterwards, by calling the the lock() manpage method a lock can be set and removed or it can be determined if and which process currently holds the lock.

File::FcntlLock (or its alias File::FcntlLock::XS) uses a shared library, build during installation, to call the the fcntl(2) manpage system function directly. If this is unsuitable there are two alternatives, File::FcntlLock::Pure and File::FcntlLock::Inline. Both call the Perl 'fcntl' function instead and use Perl code to assemble and disassemble the structure. For this at some time the (system-dependent) binary layout of the flock structure must have been determined via a program written in C. The difference between File::FcntlLock::Pure and File::FcntlLock::Inline is that for the former this happened when the package is installed while for the latter it is done each time the package is loaded (e.g., with 'use'). Thus, for File::FcntlLock::Inline to work a C compiler must be available. There are some minor differences in the functionality and the behaviour on passing the method for locking invalid arguments to be described below.


License: Artistic-1.0 or GPL-1.0+
URL: http://search.cpan.org/dist/File-FcntlLock/

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.22-bp155.2.10 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-File-FcntlLock
0.22-bp154.1.21 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-File-FcntlLock
0.22-bp153.1.16 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-File-FcntlLock
0.22-bp152.3.13 info GA Release 2020-04-16 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-File-FcntlLock
0.22-bp151.3.1 info GA Release 2019-07-17 15 SP1
  • AArch64
  • s390x
  • x86-64
  • perl-File-FcntlLock
0.22-bp151.2.14 info GA Release 2019-05-18 15 SP1
  • ppc64le
  • perl-File-FcntlLock
0.22-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-File-FcntlLock