{
    "mode": "perldoc",
    "parameter": "Mail::Box::Locker::POSIX",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3ABox%3A%3ALocker%3A%3APOSIX/json",
    "generated": "2026-06-13T12:14:35Z",
    "synopsis": "See Mail::Box::Locker",
    "sections": {
        "NAME": {
            "content": "Mail::Box::Locker::POSIX - lock a folder using kernel file-locking\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "Mail::Box::Locker::POSIX\nis a Mail::Box::Locker\nis a Mail::Reporter\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "See Mail::Box::Locker\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This locker object is created by the folder to get an exclusive lock on the file which contains\nthe data using the kernel's POSIX facilities. This lock is created on a separate file-handle to\nthe folder file, so not the handle which is reading.\n\nWARNING: Not all platforms support POSIX locking (via fcntl) and not always in the same way.\nThis implementation does not use XS to access the structure of fcntl(): it is better to use the\n::FcntlLock which does. No, this implementation \"guesses\" the location of the bytes.\n\nExtends \"DESCRIPTION\" in Mail::Box::Locker.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in Mail::Box::Locker.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in Mail::Box::Locker.\n\nMail::Box::Locker::POSIX->new(%options)\n-Option    --Defined in       --Default\nexpires     Mail::Box::Locker  1 hour\nfile        Mail::Box::Locker  undef\nfolder      Mail::Box::Locker  <undef>\nlog         Mail::Reporter     'WARNINGS'\nmethod      Mail::Box::Locker  POSIX\nposixfile                     <undef>\ntimeout     Mail::Box::Locker  10\ntrace       Mail::Reporter     'WARNINGS'\n\nexpires => SECONDS\nfile => FILENAME\nfolder => FOLDER\nlog => LEVEL\nmethod => STRING|CLASS|ARRAY\nposixfile => FILENAME\nAlternative name for \"file\", especially useful to avoid confusion when the multi-locker is\nused.\n\ntimeout => SECONDS|'NOTIMEOUT'\ntrace => LEVEL\n"
                },
                {
                    "name": "Attributes",
                    "content": "Extends \"Attributes\" in Mail::Box::Locker.\n\n$obj->expires( [SECONDS] )\nInherited, see \"Attributes\" in Mail::Box::Locker\n\n$obj->timeout( [SECONDS] )\nInherited, see \"Attributes\" in Mail::Box::Locker\n"
                },
                {
                    "name": "The Locker",
                    "content": "Extends \"The Locker\" in Mail::Box::Locker.\n\n$obj->filename( [$filename] )\nInherited, see \"The Locker\" in Mail::Box::Locker\n\n$obj->folder( [$folder] )\nInherited, see \"The Locker\" in Mail::Box::Locker\n\n$obj->name()\nInherited, see \"The Locker\" in Mail::Box::Locker\n"
                },
                {
                    "name": "Locking",
                    "content": "Extends \"Locking\" in Mail::Box::Locker.\n\n$obj->hasLock()\nInherited, see \"Locking\" in Mail::Box::Locker\n\n$obj->isLocked()\n$obj->lock()\n$obj->unlock()\nInherited, see \"Locking\" in Mail::Box::Locker\n"
                },
                {
                    "name": "Error handling",
                    "content": "Extends \"Error handling\" in Mail::Box::Locker.\n\n$obj->AUTOLOAD()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->addReport($object)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )\nMail::Box::Locker::POSIX->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->errors()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->log( [$level, [$strings]] )\nMail::Box::Locker::POSIX->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Box::Locker::POSIX->logPriority($level)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logSettings()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->notImplemented()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->report( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->reportAll( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->trace( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->warnings()\nInherited, see \"Error handling\" in Mail::Reporter\n"
                },
                {
                    "name": "Cleanup",
                    "content": "Extends \"Cleanup\" in Mail::Box::Locker.\n\n$obj->DESTROY()\nInherited, see \"Cleanup\" in Mail::Box::Locker\n"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "Warning: Folder $folder already lockf'd\nError: Package $package does not implement $method.\nFatal error: the specific package (or one of its superclasses) does not implement this\nmethod where it should. This message means that some other related classes do implement this\nmethod however the class at hand does not. Probably you should investigate this and probably\ninform the author of the package.\n\nError: Unable to check lock file $filename for $folder: $!\nTo check whether the filename is used to flock a folder, the file must be opened. Apparently\nthis fails, which does not mean that the folder is locked neither that it is unlocked.\n\nError: Unable to open POSIX lock file $filename for $folder: $!\nFor POSIX style locking, a folder it must be opened, which does not succeed for the\nspecified reason.\n\nError: Will never get a POSIX lock at $filename for $folder: $!\nTried to lock the folder, but it did not succeed. The error code received from the OS\nindicates that it will not succeed ever, so we do not need to try again.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "This module is part of Mail-Box distribution version 3.009, built on August 18, 2020. Website:\nhttp://perl.overmeer.net/CPAN/\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
            "subsections": []
        }
    },
    "summary": "Mail::Box::Locker::POSIX - lock a folder using kernel file-locking",
    "flags": [],
    "examples": [],
    "see_also": []
}