• 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:07:40 -0700


On Apr 13, 2006, at 11:02 AM, Finlay Dobbie wrote:

What does Activity Monitor use? It can even see other users' apps.
That would be ideal for me.

At a guess, sysctl(3) and Mach calls -- much like ps(1). It doesn't determine process' paths, I don't think -- I'm not even sure there's a way of doing that reliably. You can get the vnode using sysctl, but I don't think there's a reliable, supported way of going back from a vnode to a path (not even necessarily a 1-to-1 mapping).

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.


FWIW, I stared at the output of "ps -axo command" for a minute but it seemed a little inconsistent; most stuff was fine:

/System/Library/CoreServices/loginwindow.app/Contents/MacOS/ loginwindow console
/System/Library/CoreServices/pbs
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock -psn_0_393217
/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/ SystemUIServer -psn_0_524289
/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder - psn_0_655361
/Applications/iTunes.app/Contents/Resources/iTunesHelper.app/Contents/ MacOS/iTunesHelper -psn_0_786433


But some stuff was using partial paths:

ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid
nfsiod -n 4
rpc.lockd -w

Gah.
_______________________________________________
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: Jerry Krinock <email@hidden>
    • Re: Is this program open?
      • From: Ondra Cada <email@hidden>
    • 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>)

  • Prev by Date: Re: Is this program open?
  • Next by Date: Re: equivalent of "self" for willChangeValueForKey:/didChangeValueForKey:
  • Previous by thread: Re: Is this program open?
  • Next by thread: Re: Is this program open?
  • Index(es):
    • Date
    • Thread