Subject: | POSIX lock method does not work |
When trying to use the POSIX lock method like this:
my $src = new Mail::Box::Mbox folder => "sent", lock_type => "POSIX";
one gets the error:
ERROR: Unable to open POSIX lock file sent.lock for sent: No such file or directory
strace shows that indeed Mail::Box::Mbox tries to lock "sent.lock", which is the wrong file.
The deeper reason is that File::Box::File tags lock_extension to the foldername to arrive at the filename, which is both wrong as fcntl locking locks the folder itself, not a lockfile, and is a bug because the documentation claims that "lock_extension" is used for dotlocking only, when, in fact, it seems to be used for all lock types (so other types than POSIX might be broken, too).
There is another minor bug in the Mail::Box::File documentation, which claims that the "lock_file" has a default of "<foldername>.<lock-extension>", with a spurious extra "." that is not added by the code itself (the code just adds <lock_extension> without the dot).