• 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:46:54 -0700

Patchers should not try to patch a currently-running executable file. Amazingly, under OS X you can do it and get away with it :) But it could cause all sorts of problems in the field.
I was hoping to be able to implement that in an easy, non-product- specific sort of way. Maybe that's overly optimistic.



On Apr 13, 2006, at 11:39 AM, I. Savant wrote:

I guess the question is ... "why"? What are you trying to accomplish?

--
I.S.


On Apr 13, 2006, at 2:37 PM, John Stiles wrote:

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


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

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.


It's also possible, for example, that there was an application at /Volumes/MyHD/MyApp.app that was launched some time ago, and is still running, but that in the meantime /Volumes/MyHD/ MyApp.app has been replaced with something completely different, that has never been launched.

In my case that would also be a likely indicator of user sabotage :)
At any rate, I suspect the Process Manager would report the current path of the app, right? Not the path that was used when it was first launched?
It's definitely food for thought. I guess that shows one pretty significant weakness of the "ps" approach. The launched path may not equal the current path.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden


_______________________________________________ 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
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>)
 >Re: Is this program open? (From: John Stiles <email@hidden>)
 >Re: Is this program open? (From: Douglas Davidson <email@hidden>)
 >Re: Is this program open? (From: John Stiles <email@hidden>)
 >Re: Is this program open? (From: "I. Savant" <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