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.