1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-13 07:34:50 +00:00

perl5 module for file locking (flock,fcntl).

This commit is contained in:
James FitzGibbon 1996-10-24 08:02:45 +00:00
parent f2918e1612
commit a7ec8674db
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=4099
5 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# New ports collection makefile for: p5-File-Lock
# Version required: 0.9
# Date created: October 17th 1996
# Whom: James FitzGibbon <jfitz@FreeBSD.org>
#
# $Id$
#
DISTNAME= File-Lock-0.9
PKGNAME= p5-File-Lock-0.9
CATEGORIES+= devel
MASTER_SITES= ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-module/File/ \
ftp://ftp.cdrom.com/pub/perl/CPAN/modules/by-module/File/ \
ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/File/ \
ftp://ftp.leo.org/pub/comp/programming/languages/perl/CPAN/modules/by-module/File/ \
ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/modules/by-module/File/ \
ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/modules/by-module/File/
MAINTAINER= jfitz@FreeBSD.ORG
BUILD_DEPENDS= perl5.003:${PORTSDIR}/lang/perl5
do-configure:
@ cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/perl Makefile.PL
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (File-Lock-0.9.tar.gz) = 7e86e70032a899f1dd6f1f9ed70ca8d1

View File

@ -0,0 +1 @@
perl5 module for file locking (flock,fcntl).

View File

@ -0,0 +1,36 @@
This is my first alpha release of File::Lock, my version of the code
greatfully provided by Jarrko. I've mucked about with it quite a bit,
and there are a few policy decisions you might not agree with:
All of the locking functions (see t/* for full details),
File::lock::(lockf/flock/fcntl) are not exported from File::Lock. They all
take the same set of arguments: FileHandle, mode, pos, whence, length.
(Except for lockf, which doesn't take the position arguments.) Mode is two
characters, and can be "wb" for write-lock/non-blocking, or "rn", for
read-lock/blocking. Most other characters will work fine. (Look in typemap)
pos, whence, and length default to "the whole file". Use "u" to unlock a
handle.
The only OO interface is via "new File::Lock()" which uses
File::Lock::fcntl. If it were working properly, then the lock would be
unlocked on destruction. But it isn't.
File::Lock::lockfile isn't written yet, but will be.
You can use a mode of "t" or "i" to get info/test a lock. fcntl in array context
will return an array consisting of all the usual fcntl data. In any other case, a single
letter is returned, "u", "w", or "r", for the detected locking mode. (or unlocked.)
All calls return true if successful. Currently no mucking about with errno is done, so it
might not be the same for the same condition on all systems.
If you need real fcntl() and it's constants, use Fcntl. File::Lock does
optionally export SEEK_*, and LOCK_EX|UN|SH, though. (I don't remember why,
though, on the latter.)
Any comments, complaints, or bug patches would be greatly appreciated.
--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)

View File

@ -0,0 +1,11 @@
lib/perl5/site_perl/File/Lock.pm
lib/perl5/site_perl/auto/File/Lock/autosplit.ix
lib/perl5/site_perl/auto/File/Lock/info.al
lib/perl5/site_perl/auto/File/Lock/pid.al
lib/perl5/site_perl/auto/File/Lock/sysid.al
lib/perl5/site_perl/auto/File/Lock/test.al
lib/perl5/site_perl/i386-freebsd/auto/File/Lock/Lock.bs
lib/perl5/site_perl/i386-freebsd/auto/File/Lock/Lock.so
lib/perl5/site_perl/i386-freebsd/auto/File/Lock/.packlist
@dirrm lib/perl5/site_perl/i386-freebsd/auto/File/Lock
@dirrm lib/perl5/site_perl/auto/File/Lock