Re: NSTask temrinationStatus always == 1?
Re: NSTask temrinationStatus always == 1?
- Subject: Re: NSTask temrinationStatus always == 1?
- From: Jim Correia <email@hidden>
- Date: Sun, 10 May 2009 14:50:50 -0400
On Sun, May 10, 2009 at 2:18 PM, marc hoffman <email@hidden> 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.
>
> anyone have any ideas what could be going wrong to cause this?
You'll have to show your code. NSTask correctly returns the exit 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@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