David Muir Sharnoff > File-Flock-2008.01 > File::Flock

Download:
modules/File-Flock-2008.01.tar.gz

Dependencies

Annotate this POD (1)

Related Modules

File::BasicFlock
Win32::Mutex
Apache::Registry
Win32::OLE
Config::IniFiles
more...
By perlmonks.org

CPAN RT

New  1
Open  2
View/Report Bugs
Module Version: 2008.01   Source   Latest Release: File-Flock-2013.11

NAME ^

 File::Flock - file locking with flock

SYNOPSIS ^

 use File::Flock;

 lock($filename);

 lock($filename, 'shared');

 lock($filename, undef, 'nonblocking');

 lock($filename, 'shared', 'nonblocking');

 unlock($filename);

 my $lock = new File::Flock '/somefile';

 lock_rename($oldfilename, $newfilename)

DESCRIPTION ^

Lock files using the flock() call. If the file to be locked does not exist, then the file is created. If the file was created then it will be removed when it is unlocked assuming it's still an empty file.

Locks can be created by new'ing a File::Flock object. Such locks are automatically removed when the object goes out of scope. The unlock() method may also be used.

lock_rename() is used to tell File::Flock when a file has been renamed (and thus the internal locking data that is stored based on the filename should be moved to a new name). unlock() the new name rather than the original name.

LICENSE ^

File::Flock may be used/modified/distibuted on the same terms as perl itself.

AUTHOR ^

David Muir Sharnoff <muir@idiom.org>

syntax highlighting: