473,387 Members | 1,876 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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.