File::Lock::Multi::FlockFiles - flock() multiple files to emulate taking out multiple locks on a single file.
This module uses perl's flock() call on multiple files to emulate taking out multiple locks on a single file. For instance, if you ask to lock the file "foo.txt" a maximum of 5 times, File::Lock::Multi::FlockFiles will pretend to do this by acquiring locks on the files "foo.txt.1", "foo.txt.2", "foo.txt.3", etc.
flock()
File::Lock::Multi::FlockFiles
By default, these files will be deleted when the locks are released to keep it from making too much of a mess in your filesystem.
In addition to the standard File::Lock::Multi options, the following additional options are available when calling new():
new()
Clean up (unlink) our lockfiles when we're done with them.
If false, don't clean.
If set to "1", clean up lockfiles that we created.
If set to a value greater than "1", clean up lockfiles whether or not we created them.
Default: 1
A sprintf() format string used to come up with the individual lockfile names. sprintf() will be passed the file's path and the lock number as the first and second parameters. (Default: "%s.%i").
sprintf()
Copyright 2009 Tyler "Crackerjack" MacDonald <japh@crackerjack.net>
This is free software; You may distribute it under the same terms as perl itself.
File::Lock::Multi, "flock" in perlfunc
To install File::Lock::Multi, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Lock::Multi
CPAN shell
perl -MCPAN -e shell install File::Lock::Multi
For more information on module installation, please visit the detailed CPAN module installation guide.