NSTask failing
NSTask failing
- Subject: NSTask failing
- From: Randall Meadows <email@hidden>
- Date: Fri, 4 Apr 2008 14:20:16 -0600
I'm having problems with what should be a simple NSTask invocation:
NSArray *args = [NSArray arrayWithObjects:
@"-cf",
[NSString stringWithFormat:@"\"%@\"", tarFilePath],
[NSString stringWithFormat:@"\"%@\"", plistPath],
nil];
tarTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/tar"
arguments:args];
[tarTask waitUntilExit];
int status = [tarTask terminationStatus];
After all that, status = 2.
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).
tarFilePath and plistPath are full paths, and valid ones at that.
I can take the contents of all that and do it on the command line and
that works. What in the world am I missing here that is causing it to
fail?
_______________________________________________
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