Re: How can I tell if another instance is already running?
From: base60 (nobody_at_whitehouse.com)
Date: 10/30/05
- Next message: Markus Baertschi: "Re: rs6000 console"
- Previous message: Dohhhh: "Re: AIX5.2 ML-06 NIM Install hangs on the "Welcome to AIX" start page- model 275"
- In reply to: jt: "How can I tell if another instance is already running?"
- Next in thread: stmilam_at_yahoo.com: "Re: How can I tell if another instance is already running?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 Oct 2005 14:43:57 GMT
jt wrote:
> Using C to write an application, and trying to come up with a way on to
> detect if the same application which is running already.
>
> Any ideas how I can approach this in C, to check if another instance is
> already running?
Define a temporary pid file and a permanent pid file.
Write the pid to the temp file.
Check if the permanent exists, if not, link the two
and keep going.
If it does, check to see if the pid in the permanent
file is active, if true, exit. If false, link the
two and keep going.
- Next message: Markus Baertschi: "Re: rs6000 console"
- Previous message: Dohhhh: "Re: AIX5.2 ML-06 NIM Install hangs on the "Welcome to AIX" start page- model 275"
- In reply to: jt: "How can I tell if another instance is already running?"
- Next in thread: stmilam_at_yahoo.com: "Re: How can I tell if another instance is already running?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|