Main > Programming > Libraries >

File::lockf 0.20

File::lockf 0.20

Sponsored Links

File::lockf 0.20 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.003 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 919
Date added: 2007-04-27
Publisher: Paul Henson

File::lockf 0.20 description

File::lockf is a Perl module interface to the lockf system call.

SYNOPSIS

use File::lockf;

File-Lockf is an interface to the lockf system call. Perl supports the flock system call natively, but that does not acquire network locks. Perl also supports the fcntl system call, but that is somewhat ugly to use. There are other locking modules available for Perl, but none of them provided what I wanted -- a simple, clean interface to the lockf system call, without any bells or whistles getting in the way.

File-Lockf contains four functions which map directly to the four modes of lockf, and an OO wrapper class that encapulates the basic locking functionality along with an additional utility method that iteratively attempts to acquire a lock.

Lock functions

The following functions return 0 (zero) on success, and the system error number from errno on failure. They each take an open file handle as the first argument, and optionally a size parameter. Please see your system lockf man page for more details about lockf functionality on your system.

$status = File::lockf::lock(FH, size = 0)
This function maps to the F_LOCK mode of lockf.

$status = File::lockf::tlock(FH, size = 0)
This function maps to the F_TLOCK mode of lockf.

$status = File::lockf::ulock(FH, size = 0)
This function maps to the F_ULOCK mode of lockf.

$status = File::lockf::test(FH, size = 0)
This function maps to the F_TEST mode of lockf.

OO wrapper

File-Lockf also provides a simple OO wrapper class around the locking functionality, which allows you to create a lock object for a file handle and then perform lock operations with it. All of the methods return 0 (zero) on success, and the system error number from errno on failure.

$lock = new File::lockf(*FH)

This function returns a new lock object bound to the given file handle. Note that you need to pass a reference to the file handle to the constructor, not the file handle itself.

$status = $lock->lock(size = 0)
This method calls File::lockf::lock on the bound file handle.

$status = $lock->tlock(size = 0)
This method calls File::lockf::tlock on the bound file handle.

$status = $lock->ulock(size = 0)
This method calls File::lockf::ulock on the bound file handle.

$status = $lock->test(size = 0)
This method calls File::lockf::test on the bound file handle.

$status = $lock->slock(count = 5, delay = 2, size = 0)
This method will attempt to lock the bound file handle < count > times, sleeping < delay > seconds after each try. It will return 0 if the lock succeeded, or the system error number from errno if all attempts fail.

File::lockf 0.20 Screenshot

Advertisements

File::lockf 0.20 Keywords

Bookmark File::lockf 0.20

Hyperlink code:
Link for forum:

File::lockf 0.20 Copyright

WareSeeker periodically updates pricing and software information of File::lockf 0.20 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of File::lockf 0.20 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
File::NFSLock is a Perl module to do NFS (or not) locking. Free Download
File::BasicFlock is a Perl module for file locking with flock. Free Download
File::Sync is a Perl access to fsync() and sync() function calls. Free Download
AudioCD is a Perl module for basic Audio CD control. Free Download
PerlIO is a Perl module created to load on demand PerlIO layers and root of PerlIO::* name space. Free Download
File::Next::OO is a Perl module with file-finding iterator Wrapper for File::Next::files function. Free Download
Mozilla::Backup is a Perl module as a backup utility for Mozilla profiles. Free Download
File::MMagic is a Perl module to guess file type. Free Download