Re: Lock file question

2011-06-22 Thread John W. Krahn
Steven Buehler wrote: From: Jim Gibson [mailto:jimsgib...@gmail.com] On 6/22/11 Wed Jun 22, 2011 3:02 PM, "Steven Buehler" scribbled: I am trying to use a lockfile so that the script can't be run again if it is already running. The below code works fine. The problem is that if my script

RE: Lock file question

2011-06-22 Thread Steven Buehler
> -Original Message- > From: Jim Gibson [mailto:jimsgib...@gmail.com] > Sent: Wednesday, June 22, 2011 5:35 PM > To: beginners@perl.org > Subject: Re: Lock file question > > On 6/22/11 Wed Jun 22, 2011 3:02 PM, "Steven Buehler" > > scribbled: &g

Re: Lock file question

2011-06-22 Thread Jim Gibson
On 6/22/11 Wed Jun 22, 2011 3:02 PM, "Steven Buehler" scribbled: > I am trying to use a lockfile so that the script can't be run again if it is > already running. The below code works fine. The problem is that if my > script runs with an argument for a config file with one person trying to ru

RE: Lock file

2002-07-05 Thread Peter Scott
At 03:08 PM 7/5/02 +1000, Toby Stuart wrote: >Hi Karen, > > >use strict; >use warnings; > >use Fcntl qw(:flock); > >open(F,"somefile.txt") || die $!; >flock(F,LOCK_EX); ># do stuff with F >flock(F,LOCK_UN); >close(F); > There seems to be a consensus to avoid LOCK_UN, although it will make no dif

RE: Lock file

2002-07-05 Thread Toby Stuart
Hi Karen, use strict; use warnings; use Fcntl qw(:flock); open(F,"somefile.txt") || die $!; flock(F,LOCK_EX); # do stuff with F flock(F,LOCK_UN); close(F); If you're on windoze, don't expect it to work with 9x. Regards Toby -Original Message- From: Karen Liew Ying Ping [mailto:[EM