Thanks, everyone. Looks like the approach is to determine how
long I'm willing to wait, then count down from there. I especially
like John's example of using "time".
deb
John W. Krahn <[EMAIL PROTECTED]> had this to say,
>
> Maybe something like this will work for you?
>
> my $start = time
You can use sleep to pause and then use a counter to pause for a max
number of seconds.
my $max='500';
my $time=0;
unless ((&shlock("$somedir/.cache.LOCK")) or ($time==$max)) {
print "$main'program_name: cache already running\n" if $verbose;
sleep 5;
$time+=5;
}
die "Couldn't get the
Hi -
> -Original Message-
> From: Deb [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 20, 2003 12:42 PM
> To: [EMAIL PROTECTED]
> Subject: shlock and retrying
>
>
> Hi,
>
> I need to modify some code that check for the existance of a lockfile:
Deb wrote:
> Hi,
>
> I need to modify some code that check for the existance of a lockfile:
>
> unless (&shlock("$somedir/.cache.LOCK")) {
> print "$main'program_name: cache already running\n" if $verbose;
> exit;
> }
>
> I don't want to "exit" if I find the lock there. What I need to d
Deb wrote:
>
> Hi,
>
> I need to modify some code that check for the existance of a lockfile:
>
> unless (&shlock("$somedir/.cache.LOCK")) {
> print "$main'program_name: cache already running\n" if $verbose;
> exit;
> }
>
> I don't want to "exit" if I find the lock there. What I need t
Hi,
I need to modify some code that check for the existance of a lockfile:
unless (&shlock("$somedir/.cache.LOCK")) {
print "$main'program_name: cache already running\n" if $verbose;
exit;
}
I don't want to "exit" if I find the lock there. What I need to do is
back off for a short perio