Mail::...:POSIX(3pm)
π Mail::...:POSIX β the manual, but make it make sense π
okay bestie, welcome to the Mail::...:POSIX page from User Contributed Perl Documentation. yes the title is literally abbreviated like that, no I will not be explaining why. let's get into it π
β¨ NAME β¨
Mail::Box::Locker::POSIX β lock a folder using kernel file-locking π«Ά
π INHERITANCE π
Mail::Box::Locker::POSIX
is a Mail::Box::Locker
is a Mail::Reporter
so it's giving nepo baby but in the cute way, the lineage is real π
β SYNOPSIS β
See Mail::Box::Locker
that's it. that's the synopsis. go read the parent, the parent ate π
πΈ DESCRIPTION πΈ
so basically, this locker object gets made by the folder to grab an exclusive lock on the file that holds the data, and it does that using the kernel's POSIX facilities. the lock lives on a separate file-handle to the folder file β NOT the handle that's actually reading. main character lock, different handle, no crossover β¨
WARNING: not all platforms support POSIX locking (viafcntl) and even the ones that do, they don't all do it the same way. this implementation does not use XS to access the structure offcntl(). it is better to use the::FcntlLockwhich does. and no, this implementation doesn't know the struct either β it "guesses" the location of the bytes. guessing. the bytes. ma'am. π
Extends "DESCRIPTION" in Mail::Box::Locker.
π METHODS π
Extends "METHODS" in Mail::Box::Locker.
π Constructors π
Extends "Constructors" in Mail::Box::Locker.
$class->new(%options)
Inherited, see "METHODS" in Mail::Box::Locker.
here's the option rundown, with where each one comes from and what it defaults to:
expiresβ defined inMail::Box::Lockerβ default1 hourfileβ defined inMail::Box::Lockerβ defaultundeffolderβ defined inMail::Box::Lockerβ default<C<undef>>methodβ defined inMail::Box::Lockerβ defaultPOSIXposix_fileβ no parent listed β default<C<undef>>timeoutβ defined inMail::Box::Lockerβ default10
and now the options themselves, one by one, no skipping, we don't do that here π«Ά
expires => $secondsfile => $filefolder => $foldermethod => $name|CLASS|\@namesposix_file => FILENAMEβ Alternative name for "file", especially useful to avoid confusion when the multi-locker is used.timeout => $seconds|'NOTIMEOUT'
π¦ Attributes π¦
Extends "Attributes" in Mail::Box::Locker.
$obj->expires( [SECONDS] )β Inherited, see "Attributes" inMail::Box::Locker$obj->filename( [$filename] )β Inherited, see "Attributes" inMail::Box::Locker$obj->folder( [$folder] )β Inherited, see "Attributes" inMail::Box::Locker$obj->name()β Inherited, see "Attributes" inMail::Box::Locker$obj->timeout( [SECONDS] )β Inherited, see "Attributes" inMail::Box::Locker
π Locking π
Extends "Locking" in Mail::Box::Locker.
$obj->hasLock()β Inherited, see "Locking" inMail::Box::Locker$obj->isLocked()β Inherited, see "Locking" inMail::Box::Locker$obj->lock()β Inherited, see "Locking" inMail::Box::Locker$obj->unlock()β Inherited, see "Locking" inMail::Box::Locker
π Error handling π
Extends "Error handling" in Mail::Box::Locker.
$obj->AUTOLOAD()β Inherited, see "Error handling" inMail::Reporter$obj->notImplemented()β Inherited, see "Error handling" inMail::Reporter
π§Ή Cleanup π§Ή
Extends "Cleanup" in Mail::Box::Locker.
$obj->DESTROY()β Inherited, see "Cleanup" inMail::Box::Locker
π¨ DIAGNOSTICS π¨
Error: class $package does not implement method $method. Fatal error: the specific $package (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 notImplemented()
Warning: folder $name already lockf'd. Cast by lock()
Fault: unable to check lock file $file for $folder: $! To check whether the $file is used to flock a $folder, the file must be opened. Apparently this fails, which does not mean that the folder is locked neither that it is unlocked. Cast by isLocked()
Fault: unable to open POSIX lock file $file for $folder: $! For POSIX style locking, a $folder it must be opened, which does not succeed for the specified reason. Cast by lock()
Fault: will never get a POSIX lock at $file for $folder: $! Tried to lock the $folder, 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 lock()
π SEE ALSO π
This module is part of Mail-Box version 4.02, built on April 10, 2026. Website: http://perl.overmeer.net/CPAN/
π LICENSE π
For contributors see file ChangeLog.
This software is copyright (c) 2001-2026 by Mark Overmeer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie, you read all of it, slay π the source on this one is perl v5.40.1 and it's dated 2026-05-09 β go forth and lock responsibly, ily πβ¨
π¦ where this page comes from
- ubuntu stonking: libmail-box-perl 4.02-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms