Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.003.055 Times

File::lockf 0.20

  Date Added: October 02, 2010  |  Visits: 939

File::lockf

Report Broken Link
Printer Friendly Version


Product Homepage
Download (90 downloads)



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..

Requirements: No special requirements
Platforms: Linux
Keyword: Bound File Fh File File Handle Filelockf Handle Libraries Lock Method Calls Oo Perl Module Size System System Call
Users rating: 0/10

License: Freeware Size: 3.07 KB
USER REVIEWS
More Reviews or Write Review


FILE::LOCKF RELATED
Libraries  -  File::Remote 1.17
File::Remote is a Perl module to read/write/edit remote files transparently. SYNOPSIS # # Two ways to use File::Remote # # First, the function-based style. Here, we can use the # special :replace tag to overload Perl builtins! # use...
15.36 KB  
Libraries  -  File::Format::RIFF 1.0.1
File::Format::RIFF is a Perl module to Resource Interchange File Format/RIFF files. SYNOPSIS use File::Format::RIFF; open( IN, file ) or die "Could not open file: $!"; my ( $riff1 ) = File::Format::RIFF->read( *IN ); close( IN );...
9.22 KB  
Libraries  -  File::Locate 0.61
File::Locate is a Perl module to search the (s)locate-database from Perl. SYNOPSIS use File::Locate; print join "n", locate "mp3", "/usr/var/locatedb"; # or only test of something is in the database if (locate("mp3",...
20.48 KB  
Libraries  -  File::Slurp 9999.12
File::Slurp is a Perl module for efficient reading/writing of complete files. SYNOPSIS use File::Slurp; my $text = read_file( filename ) ; my @lines = read_file( filename ) ; write_file( filename, @lines ) ; use File::Slurp qw( slurp )...
26.62 KB  
Libraries  -  File::MMagic 1.27
File::MMagic is a Perl module to guess file type. SYNOPSIS use File::MMagic; use FileHandle; $mm = new File::MMagic; # use internal magic file # $mm = File::MMagic->new(/etc/magic); # use external magic file # $mm =...
21.5 KB  
Libraries  -  File::NFSLock 1.20
File::NFSLock is a Perl module to do NFS (or not) locking. SYNOPSIS use File::NFSLock qw(uncache); use Fcntl qw(LOCK_EX LOCK_NB); my $file = "somefile"; ### set up a lock - lasts until object looses scope if (my $lock = new File::NFSLock...
18.43 KB  
Libraries  -  File::Basename::Object 0.01
File::Basename::Object is a Perl module with object-oriented syntax sugar for File::Basename. SYNOPSIS my $file = File::Basename::Object->new("/path/to/a/file.html", ".htm", ".html"); if(open(my $fh, <, $file)) { print "Now reading ",...
4.1 KB  
Libraries  -  File::PathList 0.02
File::PathList is a Perl module that can find a file within a set of paths (like @INC or Java classpaths). SYNOPSIS # Create a basic pathset my $inc = File::PathList->new( @INC ); # Again, but with more explicit params my $inc2 =...
26.62 KB  
Libraries  -  File::Remove 0.34
File::Remove is a Perl module to remove files and directories. SYNOPSIS use File::Remove qw(remove); # removes (without recursion) several files remove qw( *.c *.pl ); # removes (with recursion) several directories remove 1, qw(...
14.34 KB  
Libraries  -  File::DirCompare 0.3
File::DirCompare is a Perl module to compare two directories using callbacks. SYNOPSIS use File::DirCompare; # Simple diff -r --brief replacement use File::Basename; File::DirCompare->compare($dir1, $dir2, sub { my ($a, $b) = @_; if (!...
8.19 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB