Re: runtime execution path for NSTask
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