• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is this program open?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this program open?


  • Subject: Re: Is this program open?
  • From: John Stiles <email@hidden>
  • Date: Thu, 13 Apr 2006 11:27:15 -0700

On Apr 13, 2006, at 11:16 AM, Douglas Davidson wrote:


On Apr 13, 2006, at 11:07 AM, John Stiles wrote:

I don't know the details here, but I do know that the Carbon Process Manager can reliably tell you the location of any process with a PSN. It's also apparently less work than the alternatives ;) So I'm still leaning that way, although it's imperfect.


Bear in mind that a running process need not necessarily have a location in the file system. For example, it is perfectly possible to launch an executable, leave it running, and delete the file from which it was launched, leaving the process none the worse. It sounds like the Carbon Process Manager is what you are looking for, but what you want may not always be achievable.

Here's the original question. I think it's an achievable goal.

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.

Everything else in the discussion is just a means to this end.

The only case where I can see this being impossible is transient cases —i.e., I see that the app is not running, so I flag it as all-clear, and then the app starts running a second later. However, that's not something I'm really concerned about in practice. (It would basically require the end user to sabotage my app on purpose, and in that case, so what :) )

The question got turned around because that's how - launchedApplications works. _______________________________________________
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
  • Follow-Ups:
    • Re: Is this program open?
      • From: Douglas Davidson <email@hidden>
References: 
 >Is this program open? (From: John Stiles <email@hidden>)
 >Re: Is this program open? (From: "Tom Harrington" <email@hidden>)
 >Re: Is this program open? (From: John Stiles <email@hidden>)
 >Re: Is this program open? (From: "Finlay Dobbie" <email@hidden>)
 >Re: Is this program open? (From: John Stiles <email@hidden>)
 >Re: Is this program open? (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Is this program open?
  • Next by Date: Re: Is this program open?
  • Previous by thread: Re: Is this program open?
  • Next by thread: Re: Is this program open?
  • Index(es):
    • Date
    • Thread