Determing if a process is running 
Author Message
 Determing if a process is running

How can you tell if a certain process is running?  I have a particualr
program that cannot run unless specific program is running.  How would I
be able to determine if it is running so I can display an error if the
other program is not running?

Thanks for the help

Billy



Mon, 13 Nov 2000 03:00:00 GMT  
 Determing if a process is running

: How can you tell if a certain process is running?  I have a particualr
: program that cannot run unless specific program is running.  How would I
: be able to determine if it is running so I can display an error if the
: other program is not running?

Probably the easiest way is to grep the output from ps, as long as
the name of the specific program isn't changed.

Will



Mon, 13 Nov 2000 03:00:00 GMT  
 Determing if a process is running



Quote:
>How can you tell if a certain process is running?  I have a particualr
>program that cannot run unless specific program is running.  How would I
>be able to determine if it is running so I can display an error if the
>other program is not running?

Have the other program create or lock some resource that you can test for,
make it respond to some sort of IPC, or search for it in the list of
running processes. The C language doesn't provide any way of doing any
of these thing (at least not portably and reliably), you'll need to
use some sort of platform extension. If you are talking about a Unix
environment this is best asked in comp.unix.programmer.

--
-----------------------------------------


-----------------------------------------



Mon, 13 Nov 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting function name/process from within running process.

2. Determine where I am running

3. Where am I running

4. I am new to programming and am lost

5. Determing a user a local admin

6. determing the size of a function

7. Determing alignment of (char *) pointer

8. Determing the best randomized function ...

9. Determing the correct library file to use

10. DETERMING VALID CONNECT

11. Determing all Web Browsers in an MS Windows System

12. Determing ProcessID of application that has been closed ?

 

 
Powered by phpBB® Forum Software