1Mail::Box::Locker::FlocUks(e3r)Contributed Perl DocumentMaatiilo:n:Box::Locker::Flock(3)
2
3
4

NAME

6       Mail::Box::Locker::Flock - lock a folder using kernel file-locking
7

INHERITANCE

9        Mail::Box::Locker::Flock
10          is a Mail::Box::Locker
11          is a Mail::Reporter
12

SYNOPSIS

14        See Mail::Box::Locker
15

DESCRIPTION

17       The "::Flock" object locks the folder by creating an exclusive lock on
18       the file using the kernel's "flock" facilities.  This lock is created
19       on a separate file-handle to the folder file, so not the handle which
20       is reading.
21
22       File locking does not work in some situations, for instance for
23       operating systems do not support "flock".
24

METHODS

26   Constructors
27       Mail::Box::Locker::Flock->new(OPTIONS)
28            -Option --Defined in     --Default
29             expires  Mail::Box::Locker  1 hour
30             file     Mail::Box::Locker  undef
31             folder   Mail::Box::Locker  <undef>
32             log      Mail::Reporter   'WARNINGS'
33             method   Mail::Box::Locker  'FLOCK'
34             timeout  Mail::Box::Locker  10 seconds
35             trace    Mail::Reporter   'WARNINGS'
36
37           expires => SECONDS
38           file => FILENAME
39           folder => FOLDER
40           log => LEVEL
41           method => STRING|CLASS|ARRAY
42           timeout => SECONDS|'NOTIMEOUT'
43           trace => LEVEL
44
45   The Locker
46       $obj->filename([FILENAME])
47           See "The Locker" in Mail::Box::Locker
48
49       $obj->folder([FOLDER])
50           See "The Locker" in Mail::Box::Locker
51
52       $obj->name
53           See "The Locker" in Mail::Box::Locker
54
55   Locking
56       $obj->hasLock
57           See "Locking" in Mail::Box::Locker
58
59       $obj->isLocked
60       $obj->lock
61       $obj->unlock
62           See "Locking" in Mail::Box::Locker
63
64   Error handling
65       $obj->AUTOLOAD
66           See "Error handling" in Mail::Reporter
67
68       $obj->addReport(OBJECT)
69           See "Error handling" in Mail::Reporter
70
71       $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
72           Mail::Box::Locker::Flock->defaultTrace([LEVEL]|[LOGLEVEL,
73           TRACELEVEL]|[LEVEL, CALLBACK])
74
75           See "Error handling" in Mail::Reporter
76
77       $obj->errors
78           See "Error handling" in Mail::Reporter
79
80       $obj->log([LEVEL [,STRINGS]])
81           Mail::Box::Locker::Flock->log([LEVEL [,STRINGS]])
82
83           See "Error handling" in Mail::Reporter
84
85       $obj->logPriority(LEVEL)
86           Mail::Box::Locker::Flock->logPriority(LEVEL)
87
88           See "Error handling" in Mail::Reporter
89
90       $obj->logSettings
91           See "Error handling" in Mail::Reporter
92
93       $obj->notImplemented
94           See "Error handling" in Mail::Reporter
95
96       $obj->report([LEVEL])
97           See "Error handling" in Mail::Reporter
98
99       $obj->reportAll([LEVEL])
100           See "Error handling" in Mail::Reporter
101
102       $obj->trace([LEVEL])
103           See "Error handling" in Mail::Reporter
104
105       $obj->warnings
106           See "Error handling" in Mail::Reporter
107
108   Cleanup
109       $obj->DESTROY
110           See "Cleanup" in Mail::Box::Locker
111
112       $obj->inGlobalDestruction
113           See "Cleanup" in Mail::Reporter
114

DIAGNOSTICS

116       Warning: Folder $folder already flocked
117           The folder is already locked, but you attempt to lock it again.
118           The behavior of double flock's is platform dependend, and therefore
119           should not be attempted.  The second lock is ignored (but the
120           unlock isn't)
121
122       Error: Package $package does not implement $method.
123           Fatal error: the specific package (or one of its superclasses) does
124           not implement this method where it should. This message means that
125           some other related classes do implement this method however the
126           class at hand does not.  Probably you should investigate this and
127           probably inform the author of the package.
128
129       Error: Unable to check lock file $filename for $folder: $!
130           To check whether the filename is used to flock a folder, the file
131           must be opened.  Apparently this fails, which does not mean that
132           the folder is locked neither that it is unlocked.
133
134       Error: Unable to open flock file $filename for $folder: $!
135           For flock-ing a folder it must be opened, which does not succeed
136           for the specified reason.
137
138       Error: Will never get a flock at $filename for $folder: $!
139           Tried to flock the folder, but it did not succeed.  The error code
140           received from the OS indicates that it will not succeed ever, so we
141           do not need to try again.
142

SEE ALSO

144       This module is part of Mail-Box distribution version 2.097, built on
145       January 26, 2011. Website: http://perl.overmeer.net/mailbox/
146

LICENSE

148       Copyrights 2001-2011 by Mark Overmeer. For other contributors see
149       ChangeLog.
150
151       This program is free software; you can redistribute it and/or modify it
152       under the same terms as Perl itself.  See
153       http://www.perl.com/perl/misc/Artistic.html
154
155
156
157perl v5.12.3                      2011-01-26       Mail::Box::Locker::Flock(3)
Impressum