The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Vulcan::ProcLock - Advisory lock using a regular file

SYNOPSIS

 use Vulcan::ProcLock;

 my $lock = Vulcan::ProcLock->new( '/lock/file' );

 $lock->lock();

 if ( my $pid = Vulcan::ProcLock->check( '/lock/file' ) )
 {
     print "Locked by $pid.\n";
 }
 

METHODS

check( $file )

Returns PID of owner, undef if not locked.

lock()

Attempts to acquire lock. Returns pid if successful, undef otherwise.

handle()

Returns file handle of object.

read()

Returns a running pid or undef.