On Sun, May 10, 2009 at 2:18 PM, marc hoffman <[email protected]> wrote:
> i have an odd issue with NSTask. for some reason, no matter what result code
> my executable returns (im running xcodebuild, if that matters), NSTask's
> terminationStatus always reports back as 1. if instead i use system() to run
> the exact same command, i get bak proper error codes (0 for success., other
> non-zero, non-one values for real failures.
You'll have to show your code. NSTask correctly returns the error code
(see below).
NSTask *task = nil;
task = [NSTask launchedTaskWithLaunchPath: @"/usr/bin/true"
arguments: [NSArray array]];
[task waitUntilExit];
NSLog(@"terminationStatus = %d", [task terminationStatus]);
task = [NSTask launchedTaskWithLaunchPath: @"/usr/bin/false"
arguments: [NSArray array]];
[task waitUntilExit];
NSLog(@"terminationStatus = %d", [task terminationStatus]);
- Jim
_______________________________________________
Cocoa-dev mailing list ([email protected])
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]