>SoloCDM,
>
>Short answer: You can't. (At least AFAIK :-)
>
>Long answer: You can. Almost.
>
>You may create a shell script (I believe) or a Perl script (I know) that
>will use flock to verify that it is running in one instance only. The
>script may then execute your program, which (and this is the 'almost'
>part) has an obscure name in an obscure directory that 'only you know'
>and nobody else is aware of. This assumes that 'ordinary' users may
>execute, but not read your script.
>Gustav

You start the program in the script, obtain the returned process ID
and store it where you want it.

When the child process, your program, is completed, you remove the file
with the process ID.

In any event, before you start the program, you check to see if the process
ID file is there and if it is, check to see if the PID is currently active.
If so, print a warning message and die.  If not, remove the process ID file,
start the program and create a new process ID file.

Not as tough as you think.

MB
-- 
e-mail: [EMAIL PROTECTED]
    Bart: Hey, why is it destroying other toys?  Lisa: They must have
    programmed it to eliminate the competition.  Bart: You mean like
    Microsoft?  Lisa: Exactly.  [The Simpsons - 12/18/99]
Visit - URL:http://www.vidiot.com/  (Your link to Star Trek and UPN)


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to