Re: Single Instance of a Cocoa Application.
Re: Single Instance of a Cocoa Application.
- Subject: Re: Single Instance of a Cocoa Application.
- From: Graham J Lee <email@hidden>
- Date: Wed, 19 Jul 2006 15:21:17 +0100
On 19 Jul 2006, at 15:04, <email@hidden>
<email@hidden> wrote:
Hi All,
I am developing an Cocoa Application using objC++.
I want to make sure that when one instance of my application is
running,
an user cannot launch another instance of the same application
either by
clicking the Application icon or from the terminal.
You could follow UNIX, and check for the existence of a lock file in
e.g. /var/run. If it exists, quit. If it doesn't exist, create it
and carry on. Delete the lock file on exit.
Difficulty one: if your user force quits the app, it won't run
again. That's a documentation issue :-)
Difficulty two: fast user switching means you have to name your lock
file carefully.
--
Graham J Lee
"Oxford University's UNIX Expert"
As seen in MacWorld UK
http://iamleeg.blogspot.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden