BenBart wrote:
> Hi all,
> 
> How do I prevent multiple instance of the same script from running?
> 
> That is for example, if I have a script named script1.pl and it is
> already running, I want the script to be able to check that it is
> already running and then just exit ...
> 
> Is this possible to do in both UNIX and Windows?
> 
> 
> 

One common way to do this is to convert the script into a daemon and
have init(8) start (and restart it if it dies). If the user must
communicate with it, create a client program for them and have it use
sockets to communicate with the daemon. See `perldoc perlipc` and `man
init` for details.

Sorry, not available in MS.


-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by
doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to