Re: NSTask failing
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