Re: Detecting whether app at path is running?
Re: Detecting whether app at path is running?
- Subject: Re: Detecting whether app at path is running?
- From: Brendan Younger <email@hidden>
- Date: Sat, 25 May 2002 17:53:58 -0500
On Saturday, May 25, 2002, at 04:32 PM, Matt Gemmell wrote:
1. Is NSFileManager's -isExecutableFileAtPath: method sufficient to
determine whether the file at that path is an *application*? That is, to
determine reliably whether it's a Classic, Carbon or Cocoa app (it
doesn't matter which it is; I just need to know that it *is* an
application). I suspect that it would also return true for executable
files in /usr/bin and so forth, which I wouldn't classify as
applications in the traditional sense. If not, is there a way to make
this determination is some kind of reasonably accurate way?
Look into LaunchServices.h. It's in the ApplicationServices framework.
Check out LSCopyItemInfoForRef().
2. Given the path to an item, and assuming we've already determined that
that item is indeed an application, how would I go about determining if
that application is currently running?
Carbon's process manager. You can get a list of all current processes
and their process id's with GetNextProcess() and then get their info
with GetProcessInformation().
Brendan Younger
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.