.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Mail::Box::Locker::POSIX 3" .TH Mail::Box::Locker::POSIX 3 2026-04-11 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Mail::Box::Locker::POSIX \- lock a folder using kernel file\-locking .SH INHERITANCE .IX Header "INHERITANCE" .Vb 3 \& Mail::Box::Locker::POSIX \& is a Mail::Box::Locker \& is a Mail::Reporter .Ve .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& See Mail::Box::Locker .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This locker object is created by the folder to get an exclusive lock on the file which contains the data using the kernel\*(Aqs POSIX facilities. This lock is created on a separate file\-handle to the folder file, so not the handle which is reading. .PP \&\fBWARNING\fR: Not all platforms support POSIX locking (via fcntl) and not always in the same way. This implementation does not use XS to access the structure of \fBfcntl()\fR: it is better to use the ::FcntlLock which does. No, this implementation "guesses" the location of the bytes. .PP Extends "DESCRIPTION" in Mail::Box::Locker. .SH METHODS .IX Header "METHODS" Extends "METHODS" in Mail::Box::Locker. .SS Constructors .IX Subsection "Constructors" Extends "Constructors" in Mail::Box::Locker. .ie n .IP $class\->\fBnew\fR(%options) 4 .el .IP \f(CW$class\fR\->\fBnew\fR(%options) 4 .IX Item "$class->new(%options)" Inherited, see "METHODS" in Mail::Box::Locker .Sp .Vb 7 \& \-Option \-\-Defined in \-\-Default \& expires Mail::Box::Locker 1 hour \& file Mail::Box::Locker undef \& folder Mail::Box::Locker > \& method Mail::Box::Locker POSIX \& posix_file > \& timeout Mail::Box::Locker 10 .Ve .RS 4 .ie n .IP "expires => $seconds" 2 .el .IP "expires => \f(CW$seconds\fR" 2 .IX Item "expires => $seconds" .PD 0 .ie n .IP "file => $file" 2 .el .IP "file => \f(CW$file\fR" 2 .IX Item "file => $file" .ie n .IP "folder => $folder" 2 .el .IP "folder => \f(CW$folder\fR" 2 .IX Item "folder => $folder" .ie n .IP "method => $name|CLASS|\e@names" 2 .el .IP "method => \f(CW$name\fR|CLASS|\e@names" 2 .IX Item "method => $name|CLASS|@names" .IP "posix_file => FILENAME" 2 .IX Item "posix_file => FILENAME" .PD Alternative name for \f(CW\*(C`file\*(C'\fR, especially useful to avoid confusion when the multi\-locker is used. .ie n .IP "timeout => $seconds|\*(AqNOTIMEOUT\*(Aq" 2 .el .IP "timeout => \f(CW$seconds\fR|\*(AqNOTIMEOUT\*(Aq" 2 .IX Item "timeout => $seconds|'NOTIMEOUT'" .RE .RS 4 .RE .SS Attributes .IX Subsection "Attributes" Extends "Attributes" in Mail::Box::Locker. .ie n .IP "$obj\->\fBexpires\fR( [SECONDS] )" 4 .el .IP "\f(CW$obj\fR\->\fBexpires\fR( [SECONDS] )" 4 .IX Item "$obj->expires( [SECONDS] )" Inherited, see "Attributes" in Mail::Box::Locker .ie n .IP "$obj\->\fBfilename\fR( [$filename] )" 4 .el .IP "\f(CW$obj\fR\->\fBfilename\fR( [$filename] )" 4 .IX Item "$obj->filename( [$filename] )" Inherited, see "Attributes" in Mail::Box::Locker .ie n .IP "$obj\->\fBfolder\fR( [$folder] )" 4 .el .IP "\f(CW$obj\fR\->\fBfolder\fR( [$folder] )" 4 .IX Item "$obj->folder( [$folder] )" Inherited, see "Attributes" in Mail::Box::Locker .ie n .IP $obj\->\fBname\fR() 4 .el .IP \f(CW$obj\fR\->\fBname\fR() 4 .IX Item "$obj->name()" Inherited, see "Attributes" in Mail::Box::Locker .ie n .IP "$obj\->\fBtimeout\fR( [SECONDS] )" 4 .el .IP "\f(CW$obj\fR\->\fBtimeout\fR( [SECONDS] )" 4 .IX Item "$obj->timeout( [SECONDS] )" Inherited, see "Attributes" in Mail::Box::Locker .SS Locking .IX Subsection "Locking" Extends "Locking" in Mail::Box::Locker. .ie n .IP $obj\->\fBhasLock\fR() 4 .el .IP \f(CW$obj\fR\->\fBhasLock\fR() 4 .IX Item "$obj->hasLock()" Inherited, see "Locking" in Mail::Box::Locker .ie n .IP $obj\->\fBisLocked\fR() 4 .el .IP \f(CW$obj\fR\->\fBisLocked\fR() 4 .IX Item "$obj->isLocked()" Inherited, see "Locking" in Mail::Box::Locker .ie n .IP $obj\->\fBlock\fR() 4 .el .IP \f(CW$obj\fR\->\fBlock\fR() 4 .IX Item "$obj->lock()" Inherited, see "Locking" in Mail::Box::Locker .ie n .IP $obj\->\fBunlock\fR() 4 .el .IP \f(CW$obj\fR\->\fBunlock\fR() 4 .IX Item "$obj->unlock()" Inherited, see "Locking" in Mail::Box::Locker .SS "Error handling" .IX Subsection "Error handling" Extends "Error handling" in Mail::Box::Locker. .ie n .IP $obj\->\fBAUTOLOAD\fR() 4 .el .IP \f(CW$obj\fR\->\fBAUTOLOAD\fR() 4 .IX Item "$obj->AUTOLOAD()" Inherited, see "Error handling" in Mail::Reporter .ie n .IP $obj\->\fBnotImplemented\fR() 4 .el .IP \f(CW$obj\fR\->\fBnotImplemented\fR() 4 .IX Item "$obj->notImplemented()" Inherited, see "Error handling" in Mail::Reporter .SS Cleanup .IX Subsection "Cleanup" Extends "Cleanup" in Mail::Box::Locker. .ie n .IP $obj\->\fBDESTROY\fR() 4 .el .IP \f(CW$obj\fR\->\fBDESTROY\fR() 4 .IX Item "$obj->DESTROY()" Inherited, see "Cleanup" in Mail::Box::Locker .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" .ie n .IP "Error: class $package does not implement method $method." 4 .el .IP "Error: class \f(CW$package\fR does not implement method \f(CW$method\fR." 4 .IX Item "Error: class $package does not implement method $method." Fatal error: the specific \f(CW$package\fR (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by \f(CWnotImplemented()\fR .ie n .IP "Warning: folder $name already lockf\*(Aqd." 4 .el .IP "Warning: folder \f(CW$name\fR already lockf\*(Aqd." 4 .IX Item "Warning: folder $name already lockf'd." Cast by \f(CWlock()\fR .ie n .IP "Fault: unable to check lock file $file for $folder: $!" 4 .el .IP "Fault: unable to check lock file \f(CW$file\fR for \f(CW$folder:\fR $!" 4 .IX Item "Fault: unable to check lock file $file for $folder: $!" To check whether the \f(CW$file\fR is used to flock a \f(CW$folder\fR, the file must be opened. Apparently this fails, which does not mean that the folder is locked neither that it is unlocked. Cast by \f(CWisLocked()\fR .ie n .IP "Fault: unable to open POSIX lock file $file for $folder: $!" 4 .el .IP "Fault: unable to open POSIX lock file \f(CW$file\fR for \f(CW$folder:\fR $!" 4 .IX Item "Fault: unable to open POSIX lock file $file for $folder: $!" For POSIX style locking, a \f(CW$folder\fR it must be opened, which does not succeed for the specified reason. Cast by \f(CWlock()\fR .ie n .IP "Fault: will never get a POSIX lock at $file for $folder: $!" 4 .el .IP "Fault: will never get a POSIX lock at \f(CW$file\fR for \f(CW$folder:\fR $!" 4 .IX Item "Fault: will never get a POSIX lock at $file for $folder: $!" Tried to lock the \f(CW$folder\fR, but it did not succeed. The error code received from the OS indicates that it will not succeed ever, so we do not need to try again. Cast by \f(CWlock()\fR .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail\-Box version 4.02, built on April 10, 2026. Website: \fIhttp://perl.overmeer.net/CPAN/\fR .SH LICENSE .IX Header "LICENSE" For contributors see file ChangeLog. .PP This software is copyright (c) 2001\-2026 by Mark Overmeer. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.