473,387 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Checking whether the exe is running or not

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

Mar 17 '06 #1
5 3193
pl**********@gmail.com wrote:
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

--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com
"You can't KISS* unless you MISS**"
[*-Keep it simple, stupid. **-Make it simple, stupid.]
Mar 17 '06 #2
pl**********@gmail.com 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.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Mar 17 '06 #3
On Thu, 16 Mar 2006 20:48:08 -0800, plmanikandan wrote:
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.

Mar 17 '06 #4
pl**********@gmail.com wrote:
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.
--
My Personal Weblog:
http://spaces.msn.com/cyberisblue
Mar 17 '06 #5

"yong" <lu********@enorth.com.cn> wrote in message
news:dv**********@news.yaako.com...
pl**********@gmail.com wrote:
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>


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.

--
My Personal Weblog:
http://spaces.msn.com/cyberisblue

--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
Mar 17 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Deepak Sarda | last post by:
Hello everyone. I have run into something which I believe is a bug or a shortcoming of the threading.Thread module. My program spawns 15 threads. For this I've creating a new class with...
0
by: Mike Meyer | last post by:
The recent thread on threads caused me to reread the formal definition of SCOOP, and I noticed something I hadn't really impressed me the first time around: it's using staticly checkable rules to...
30
by: Michael B Allen | last post by:
I have a general purpose library that has a lot of checks for bad input parameters like: void * linkedlist_get(struct linkedlist *l, unsigned int idx) { if (l == NULL) { errno = EINVAL;...
2
by: Marlene Stebbins | last post by:
I am entering numbers into my program from the command line. I want to check whether they are > INT_MAX. Sounds simple, but I've discovered that if(x <= INT_MAX) { /* use x in some calculation...
5
by: kd | last post by:
Hi All, If the name of a process is known, is it possible to check whether it is in execution? What I did was to fetch all the processes running on the system using Process.GetProcesses() and...
1
by: Ennio-Sr | last post by:
Hi all! Testing a script where I need to make sure that postgresql is running before passing a <psql dbasename -c "insert into ..." > instruction I faced this curious behaviour: This is the...
7
by: pradeep_TP | last post by:
hello all, I want to know how can I check whether a web site us running or not. I have used HttpWebRequest but when I give a web site address, It takes few number of seconds to throw exception...
1
by: plmanikandan | last post by:
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...
27
by: RobG | last post by:
I was investigating a function to determine whether daylight saving was being observed on a particular date (given the platform's regional settings) and came across a suggestion at merlyn.com to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.