Proc::tored::LockFile - Guard actions with atomic writes
version 0.20
use Proc::tored::LockFile; my $lockfile = Proc::tored::LockFile->new(file_path => '/path/to/something.lock'); if (my $lock = $lockfile->lock) { ... }
Path where lock file should be created.
Attempts to lock the guarded resource by created a new file at "file_path". If the file could not be created because it already exists (using O_CREAT|O_EXCL), the lock attempt fails and undef is returned. If the lock is successfully acquired, a Guard object is returned that will unlink the lock file as it falls out of scope.
O_CREAT|O_EXCL
Jeff Ober <sysread@fastmail.fm>
This software is copyright (c) 2017 by Jeff Ober.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Proc::tored, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Proc::tored
CPAN shell
perl -MCPAN -e shell install Proc::tored
For more information on module installation, please visit the detailed CPAN module installation guide.