PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

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.

Regards,
Yuri.

> -----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
> documented
> in the Camel book.
> 
> --
> Steve Wechsler/Senior DB Administrator/Sanford C. Bernstein & Co.
> WechslerSM@bernstein.com 
> "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.
> >