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

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


  • Follow-Ups:
    • Re: NSTask failing
      • From: Nir Soffer <email@hidden>
    • Re: NSTask failing
      • From: Peter Maurer <email@hidden>
    • Re: NSTask failing
      • From: "Hamish Allan" <email@hidden>
    • Re: NSTask failing
      • From: "Herb Petschauer" <email@hidden>
  • Prev by Date: Re: NSMutableArray removeObject: crash
  • Next by Date: Re: NSMutableArray removeObject: crash
  • Previous by thread: Re: NSMutableArray removeObject: crash
  • Next by thread: Re: NSTask failing
  • Index(es):
    • Date
    • Thread