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