Skip to Content.
Sympa Menu

Documentation for Sympa

NAME

Sympa::LockedFile - Filehandle with locking

SYNOPSIS

 use Sympa::LockedFile;
 
 # Create filehandle acquiring lock.
 my $fh = Sympa::LockedFile->new('/path/to/file', 20, '+<') or die;
 # or,
 my $fh = Sympa::LockedFile->new();
 $fh->open('/path/to/file', 20, '+<') or die;
 
 # Operations...
 while (<$fh>) { ... }
 seek $fh, 0, 0;
 truncate $fh, 0;
 print $fh "blah blah\n";
 # et cetera.

 # Close filehandle releasing lock.
 $fh->close;

DESCRIPTION

This class implements a filehandle with locking.

Class Methods

Instance Methods

Instances of Sympa::LockedFile support the methods provided by IO::File.

Following methods are specific to this module.

SEE ALSO

“Functions for filehandles, files or directories” in perlfunc, “I/O Operators” in perlop, IO::File, File::NFSLock.

HISTORY

Lock module written by Olivier Salaün appeared on Sympa 5.3.

Support for NFS was added by Kazuo Moriwaka.

Rewritten Sympa::LockedFile module was initially written by IKEDA Soji for Sympa 6.2.

Top of Page