• Subject: Re: How to tell if a program is active?
  • From: Jim Langston <jlangston@xxxxxxxxxxxxxxxx>
  • Date: Mon, 22 Nov 1999 11:53:10 -0800
  • Organization: Conex Global Logistics Services, Inc.

I don't know any tricks for this, but I have done it one or two ways
in the past.

1. Look to see if a certain file exists.
2. If it exists, exit, program is already active
3. Create the file and do the program.

Thinking on it, though, I think there might be a better way.

1. ACLOBJ *EXCL of the program that is running.
It appears that when a program is running it doesn't actually have a lock
on the program itself.  At least for the one I just checked, although it was
a native program (S/36 RPG II).
I would think that if the *pgm was opened *EXCL it couldn't be read to
be run.
That would probably do the trick.

Regards,

Jim Langston
do while (!succeed());

"Reger, Bill" wrote:

> I need to make sure that a particular program is running only once.  I do
> not want multiple occurrences of this program to be running.  I'm sure my
> mind is already on Thanksgiving time since I can't seem to figure out how I
> can check whether a certain program is active or not.  Can anyone help me?

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].