• 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: How do I find out if a process is running if I have the process Name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I find out if a process is running if I have the process Name?


  • Subject: Re: How do I find out if a process is running if I have the process Name?
  • From: John Stiles <email@hidden>
  • Date: Thu, 18 May 2006 11:25:59 -0700


On May 18, 2006, at 11:15 AM, Ondra Cada wrote:

John,

On 18.5.2006, at 19:16, John Stiles wrote:

You can also use Mach APIs if you have root access. I don't remember many of the details here. I believe Activity Monitor works this way; it launches a tool with the "run with root privs" bit set.

If going that far, probably launching ps and parsing its output would prove easier. Unless you need something which ps could not offer, and that's not too probable.

Yeah, that's a good option #5 that I didn't list.

AFAIK none of these solutions work quite right if you move or rename the app after it has been launched. You will get back the path that it was originally launched from. This is a sad downgrade from OS 9 but I guess it is a hard problem to solve.

It's not downgrade, it's upgrade--since it effectively means you can do whatever you want with the program file (even deleting it) without breaking the proces which was launched upon it. That's more flexibility, and thence definitely a good thing.

You can do anything you want, except find the darn thing on the hard disk. Yes, some of us actually want the current path to the running app, even if it might move again in the future. In OS 9 you could move or rename apps just fine while they were running and still find them. (You couldn't delete them, but I think that was by design—let's face it, how many of us are writing apps which will keep on running if the whole bundle suddenly got rm -rf'ed? This is just a basic way of protecting the user.)


_______________________________________________
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: How do I find out if a process is running if I have the process Name?
      • From: "Michael Ash" <email@hidden>
References: 
 >How do I find out if a process is running if I have the process Name? (From: Scott Mitchell <email@hidden>)
 >Re: How do I find out if a process is running if I have the process Name? (From: Nick Zitzmann <email@hidden>)
 >Re: How do I find out if a process is running if I have the process Name? (From: John Stiles <email@hidden>)
 >Re: How do I find out if a process is running if I have the process Name? (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: NSTreeController: do leaf and non-leaf nodes have to be of the same class?
  • Next by Date: coredata sql store on WebDAV mounted volume
  • Previous by thread: Re: How do I find out if a process is running if I have the process Name?
  • Next by thread: Re: How do I find out if a process is running if I have the process Name?
  • Index(es):
    • Date
    • Thread