Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Make a perl script self aware...

by sgifford (Prior)
on Aug 01, 2003 at 18:06 UTC ( [id://280072]=note: print w/replies, xml ) Need Help??


in reply to Make a perl script self aware...

The device you're looking for is called a mutex.

In UNIX, you can use locks for this. Create a lock file, lock it with fcntl. If somebody's already holding the lock (your nonblocking request for a lock is denied), somebody else is already running; if it works, you're in the clear. If the process dies or exits, the OS will automatically remove the lock.

Surely Windows has a lock that works like this, or some other form of mutex.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://280072]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-20 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found