Re: runtime execution path for NSTask
Re: runtime execution path for NSTask
- Subject: Re: runtime execution path for NSTask
- From: "Tom Harrington" <email@hidden>
- Date: Fri, 13 Jul 2007 13:16:33 -0600
On 7/13/07, Chris Heimark <email@hidden> wrote:
I'm using an NSTask object to run a command line program. Everything
works as expected and I am just buttoning things up ... one of which
is a hard coding of a path to my executable for NSTask. If I let
Xcode execute either debug or release versions of Cocoa app, it finds
my executable in same directory no problem. When I double-click Cocoa
app out of finder, execution path is marked as '/' which I have
discovered has the meaning of 'relative path' in this context. 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?
I have searched docs high and low and find only vague reference to
relative path using NSFileManager methods.
Look in NSBundle instead. Use NSBundle methods to find the location
of the Cocoa application, and then locate your command-line tool
relative to that.
--
Tom Harrington
email@hidden
AIM: atomicbird1
_______________________________________________
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