Re: Is this program open?
Re: Is this program open?
- Subject: Re: Is this program open?
- From: "Tom Harrington" <email@hidden>
- Date: Thu, 13 Apr 2006 11:41:28 -0600
On 4/13/06, John Stiles <email@hidden> wrote:
> Given a path (or FSRef/NSURL/whatever) to an application's executable:
> /Volumes/MyHD/MyApp.app/Contents/MacOS/MyApp
>
> I want to check to see if this executable is running, hopefully in a
> semi-lightweight way (I may be doing this several times for different
> apps). It would be cool if the same technique worked for command-line
> tools too, but that's not a strict requirement.
>
> Is there a way to accomplish this, using either Cocoa, Carbon or
> lower-level Posix calls? (Technically, Posix would be a little better
> fit for us, since we could avoid forking the code. Either way is
> fine, though.)
I think you want to look at [[NSWorkspace sharedWorkspace]
launchedApplications]. Then scan the resulting dictionaries for your
path-- in the NSApplicationPath key.
I'm sure it's possible in Carbon, but that's the obvious Cocoa starting point.
--
Tom Harrington
email@hidden
AIM: atomicbird1
_______________________________________________
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