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 PROTECTED]> wrote:
NSArray *args = [NSArray arrayWithObjects:
 @"-cf",
 [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", tarFilePath],
 [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to