• 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: "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


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

  • Prev by Date: runtime execution path for NSTask
  • Next by Date: Re: Objective-C/Cocoa connectivity to Relational Databases
  • Previous by thread: runtime execution path for NSTask
  • Next by thread: Re: runtime execution path for NSTask
  • Index(es):
    • Date
    • Thread