Mail::...tlLock(3pm)

πŸ’– Mail::Box::Locker::FcntlLock β€” the manual, but make it cute πŸ’–

okay bestie, so this is a page from User Contributed Perl Documentation and it's about locking folders with File::FcntlLock. yeah it's giving "niche" but it's also giving "actually works on your Mac". let's go πŸ’…


✨ NAME ✨

Mail::Box::Locker::FcntlLock β€” lock a folder using File::FcntlLock

like. that's the whole job. it locks a folder. with FcntlLock. slay πŸŽ€


🌸 INHERITANCE 🌸

the family tree, no cap:

Mail::Box::Locker::FcntlLock
  is a Mail::Box::Locker
  is a Mail::Reporter

so it inherits from Mail::Box::Locker, which itself inherits from Mail::Reporter. iconic lineage honestly πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

See Mail::Box::Locker

yeah that's it, that's the synopsis. go read the parent class, bestie 🫢


⭐ DESCRIPTION ⭐

so this locker object uses File::FcntlLock, and it was contributed by Jim in Aus. we love him. thank you Jim πŸ’–

it's close to Mail::Box::Locker::POSIX, but lowkey better because it does work on more systems β€” for instance, Darwin. yes, your MacBook. you're welcome.

⚠️ heads up bestie: you will need to install File::FcntlLock separately. there is no dependency to it by the MailBox distribution. it is not coming with the kit. go get it yourself, periodt.

this extends "DESCRIPTION" in Mail::Box::Locker. ✨


πŸŽ€ METHODS πŸŽ€

extends "METHODS" in Mail::Box::Locker, iykyk.

πŸ’œ Constructors

extends "Constructors" in Mail::Box::Locker.

$class->new(%options)

Inherited, see "METHODS" in Mail::Box::Locker.

here's the whole option table, every single row, no skipping:

 -Option --Defined in       --Default
  expires  Mail::Box::Locker  1 hour
  file     Mail::Box::Locker  undef
  folder   Mail::Box::Locker  <C<undef>>
  method   Mail::Box::Locker  FcntlLock
  timeout  Mail::Box::Locker  10

and the individual ones, spelled out:

  • expires => $seconds β€” how long the lock gets to live before it's expired πŸ‘‘
  • file => $file β€” the lock file, you decide πŸ“
  • folder => $folder β€” which folder we're talking about πŸ—‚οΈ
  • method => $name|CLASS|\@names β€” the locking method, or a class, or a whole list of them 😌
  • timeout => $seconds|'NOTIMEOUT' β€” how long to wait, or literally the string 'NOTIMEOUT' if you have zero patience ⏰

🌈 Attributes

extends "Attributes" in Mail::Box::Locker.

  • $obj->expires( [SECONDS] ) β€” Inherited, see "Attributes" in Mail::Box::Locker
  • $obj->filename( [$filename] ) β€” Inherited, see "Attributes" in Mail::Box::Locker
  • $obj->folder( [$folder] ) β€” Inherited, see "Attributes" in Mail::Box::Locker
  • $obj->name() β€” Inherited, see "Attributes" in Mail::Box::Locker
  • $obj->timeout( [SECONDS] ) β€” Inherited, see "Attributes" in Mail::Box::Locker

πŸ”’ Locking

extends "Locking" in Mail::Box::Locker.

  • $obj->hasLock() β€” Inherited, see "Locking" in Mail::Box::Locker
  • $obj->isLocked() β€” Inherited, see "Locking" in Mail::Box::Locker
  • $obj->lock() β€” Inherited, see "Locking" in Mail::Box::Locker
  • $obj->unlock() β€” Inherited, see "Locking" in Mail::Box::Locker

😭 Error handling

extends "Error handling" in Mail::Box::Locker.

  • $obj->AUTOLOAD() β€” Inherited, see "Error handling" in Mail::Reporter
  • $obj->notImplemented() β€” Inherited, see "Error handling" in Mail::Reporter

🧹 Cleanup

extends "Cleanup" in Mail::Box::Locker.

  • $obj->DESTROY() β€” Inherited, see "Cleanup" in Mail::Box::Locker

πŸ’€ DIAGNOSTICS πŸ’€

the part where things go wrong. buckle up, bestie πŸ“

Fault: Will never get a FcntlLock lock at $file for $folder: $!

it tried to lock the $folder, and it just. did not succeed. the error code it got back from the OS is basically saying "this is never gonna work, not now, not ever", so there is genuinely no point trying again. cast by lock(). πŸ’€

Error: class $package does not implement method $method.

fatal error, no cap. the specific $package (or one of its superclasses) does not implement this method where it should. what this means: some other related classes do implement this method, but the class you're holding right now does not. probably you should investigate this. and probably you should inform the author of the package. 😭 cast by notImplemented()

Warning: folder $name already lockf'd.

cast by lock(). someone got there first, bestie. πŸ™ˆ

Fault: unable to check lock file $file for $folder: $!

to check whether the filename is used to flock a folder, the file has to be opened. apparently this fails β€” which does not mean the folder is locked, and it does not mean it's unlocked either. it's just. unknown. haunting honestly. πŸ‘»

Fault: unable to open FcntlLock lock file $file for $folder

for FcntlLock style locking, a $folder must be opened, and that does not succeed, for the specified reason. 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. slay, honestly 🌈


and that's the whole page, bestie. this one came out with perl v5.40.1 on 2026-05-09 πŸ’– stay locked, stay iconic βœ¨πŸŽ€

πŸ“¦ where this page comes from