Re: shlock and retrying

2003-02-21 Thread Deb
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

Re: shlock and retrying

2003-02-20 Thread Pete Emerson
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

RE: shlock and retrying

2003-02-20 Thread Beau E. Cox
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:

RE: shlock and retrying

2003-02-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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

Re: shlock and retrying

2003-02-20 Thread John W. Krahn
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

shlock and retrying

2003-02-20 Thread Deb
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