Checking whether the exe is running or not

P

plmanikandan

Hi,

I am having a exe application which will be triggered by a external
program.I need to check whether the exe is already running or not.If
the exe is runing i need to discard the external program request.Is
there any function available in c to check whether exe is running or
not


Regards,
Manikanda
 
R

Richard Heathfield

(e-mail address removed) said:
Hi,

I am having a exe application which will be triggered by a external
program.I need to check whether the exe is already running or not.If
the exe is runing i need to discard the external program request.Is
there any function available in c to check whether exe is running or
not

ISO C's standard library possesses no such function, but your implementation
may provide one. I suggest you consult a newsgroup devoted to discussing
programming on your particular platform, whatever that may be.
 
A

Artie Gold

Hi,

I am having a exe application which will be triggered by a external
program.I need to check whether the exe is already running or not.If
the exe is runing i need to discard the external program request.Is
there any function available in c to check whether exe is running or
not

There is not.

Absent some platform specific (hint, hint) method, you could have the
application create a `lock' file of some sort at startup and remove it
when the program ends; if the file exists, you'd know it was running
(or, at least, hadn't terminated normally).

HTH,
--ag
 
W

William Ahern

Hi,

I am having a exe application which will be triggered by a external
program.I need to check whether the exe is already running or not.If
the exe is runing i need to discard the external program request.Is
there any function available in c to check whether exe is running or
not

Entirely platform dependent. You need access to some mutual exclusion
device. The nature and character of it is entirely dependent on your
platform.

comp.unix.programmer would be a good place to ask if you're using a Unix
or POSIX platform.
 
Y

yong

Hi,

I am having a exe application which will be triggered by a external
program.I need to check whether the exe is already running or not.If
the exe is runing i need to discard the external program request.Is
there any function available in c to check whether exe is running or
not


Regards,
Manikanda

Is you are using UNIX.You can find it out like this

ps aux|grep <filename>

If you are using windows,pressing Ctrl+Alt+Del and see if the .exe file
is in the list.
 
F

Fred Kleinschmidt

yong said:
Is you are using UNIX.You can find it out like this

ps aux|grep <filename>

Not necessarily. The app may have been executed via a link with a different
name than the actual program.
If you are using windows,pressing Ctrl+Alt+Del and see if the .exe file
is in the list.

This requires user intervention. The OP obviously wants to check
programmatically.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top