Re: [ILUG] [OT] perl: file locking with flock

From: Donnchadh Q=20Donnabh=E1in?= (d_odonnabhain at domain vistech.ie)
Date: Mon 28 Feb 2000 - 17:29:05 GMT


John Gaughan wrote:
> attempt to flock() fails. One other thing. I'm not sure it this is normal
> behaviour for the libc version of flock(), but if the file has been locked
> already, perl's flock() appears to wait for the first lock to be released
> and then locks the file, rather than returning an error.

   According to the flock(2) manpage this is correct. If you want
nonblocking behaviour use LOCK_NB and flock will fail with errno =
 EWOULDBLOCK

   Donnchadh

-- 
// Donnchadh O Donnabhain  mailto:d_odonnabhain at domain vistech.ie
// Vistech Software        http://www.vistechsoftware.com
// Inchvale House, Douglas West, Cork, Ireland
// Ph. +353-21-918166      Fax +353-21-896142


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:05:30 GMT