• 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: NSTask failing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask failing


  • Subject: Re: NSTask failing
  • From: Peter Maurer <email@hidden>
  • Date: Fri, 4 Apr 2008 23:40:59 +0200

I've tried making the arguments only 1 entry in the array, and the same thing; I've both quoting and not quoting the arguments, and the same thing; I've tried using a dash with the options and without, and the same thing--always status=2 (fatal error).

You should unquote those paths, because ...

I do something very similar.  The only difference is I'm not
constructing a path via stringWithFormat.  I'm using either NSString's
"fileSystemRepresentation" [...]

... NSTask does that for you automatically -- see the documentation on -setArguments: and +launchedTaskWithLaunchPath:arguments:. So the additional quotes might actually make NSTask -- or, more precisely: [NSString fileSystemRepresentation] -- choke on your paths. (I haven't ever tested this, though. Maybe NSTask is smart enough to strip those superfluous quotes if necessary.)


As far as getting that error 2 for unquoted paths is concerned, it would definitely be interesting to see whether logging your arguments to the console yields the exact same paths you've used when doing this successfully in Terminal.

Peter.
_______________________________________________

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


  • Follow-Ups:
    • Re: NSTask failing
      • From: Randall Meadows <email@hidden>
References: 
 >NSTask failing (From: Randall Meadows <email@hidden>)

  • Prev by Date: Re: enterFullScreenMode trouble
  • Next by Date: Re: NSTask failing
  • Previous by thread: Re: NSTask failing
  • Next by thread: Re: NSTask failing
  • Index(es):
    • Date
    • Thread