• 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: runtime execution path for NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: runtime execution path for NSTask


  • Subject: Re: runtime execution path for NSTask
  • From: Chris Heimark <email@hidden>
  • Date: Fri, 13 Jul 2007 17:55:34 -0400

Excellent! I am getting to really like Cocoa. I used the resource path message

[[NSBundle mainBundle] pathForResource:@"read-data-usb" ofType:nil]

thus allowing application dependency on the command line program to remain hidden away in the bundle where my users are unlikely to find it and accidently eliminate it!

Very nice ;-)

Thanks guys!

On Jul 13, 2007, at 4:45 PM, John Stiles wrote:


On Jul 13, 2007, at 12:22 PM, Nick Zitzmann wrote:


On Jul 13, 2007, at 1:04 PM, Chris Heimark wrote:

If a command line program and Cocoa app are in same directory, how do I tell NSTask that executable is in same path (not relative) as the launching Cocoa app?

Use NSBundle to get the path of the executable. Don't ever rely on the state of the PWD.

… unless, of course, you set it yourself first :)



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: reason for getting NSFileHandle:writeData exception (From: Kevin Kuehl <email@hidden>)
 >runtime execution path for NSTask (From: Chris Heimark <email@hidden>)
 >Re: runtime execution path for NSTask (From: Nick Zitzmann <email@hidden>)
 >Re: runtime execution path for NSTask (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Format Drive as FAT in Cocoa (XCode)
  • Next by Date: Re: Using proxy objects with NSMutableArray
  • Previous by thread: Re: runtime execution path for NSTask
  • Next by thread: Window bounds error?
  • Index(es):
    • Date
    • Thread