Up Prev Next
From: "Khait, Yuri" <yurkhait at Mobility dot com>
Subject: RE: Process on NT
Date: Mar 25 1999 12:27AM
Thank you, Steven.
It looks like if I use non-blocking flock() ($LOCK_NB = 4) It always give me
return code 0, even if the file was not locked before.
If I use exclusive blocking flock() ($LOCK_EX = 2) then the second process
just hangs and wait until the block is released.
I would like the second process just quietly exit with some sort of message.
> -----Original Message-----
> From: Wechsler, Steven M [SMTP:WechslerSM@bernstein.com]
> Sent: Wednesday, March 24, 1999 5:03 PM
> To: SybPerl Discussion List
> Subject: RE: Process on NT
> If you're trying to prevent the same script from running more than once, I
> use a non-blocking flock() to attempt to lock a file; if the script is
> unable to lock it, it means that it's already running. It's well
> in the Camel book.
> Steve Wechsler/Senior DB Administrator/Sanford C. Bernstein & Co.
> "Never underestimate the power of human stupidity" - Lazarus Long
> Support the Anti-SPAM amendment: http://www.cauce.org
> > -----Original Message-----
> > From: Khait, Yuri [mailto:yurkhait@Mobility.com]
> > Sent: Wednesday, March 24, 1999 4:24 PM
> > To: SybPerl Discussion List
> > Subject: Process on NT
> > I'm running Perl script on NT.
> > Is there a way to find out that similar process is running ?
> > Regards,
> > Yuri.