Re: NSTask failing
Re: NSTask failing
- Subject: Re: NSTask failing
- From: Michael Vannorsdel <email@hidden>
- Date: Fri, 4 Apr 2008 15:18:41 -0600
The error 2 means tar is not happy with one of both provided paths.
Try printing out both paths and make sure they're proper. Paths
passed to NSTask should not have escapes such as "/Some\ Folder/
file.tar", it should be "/Some Folder/files.tar".
On Apr 4, 2008, at 3:00 PM, Randall Meadows wrote:
On 04/04/2008, Randall Meadows <email@hidden> wrote:
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];
I do something very similar. The only difference is I'm not
constructing a path via stringWithFormat. I'm using either
NSString's
"fileSystemRepresentation" or NSURL's "path" method to get a well
formed path to pass in as a parameter...
So I wonder what your stringWithFormat results actually look like.
_______________________________________________
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