Re: NSTask terminates when NSApplication exits
Re: NSTask terminates when NSApplication exits
- Subject: Re: NSTask terminates when NSApplication exits
- From: Andrew <email@hidden>
- Date: Wed, 18 Jan 2012 14:33:54 -0700
Thanks, I'll have a look.
BTW, I was able to confirm it is a result of streams. My Java
processes do not quit if I pipe their output to null:
NSTask *task = [NSTask new];
[task setLaunchPath:execPath];
[task setCurrentDirectoryPath:_directory];
[task setArguments:arguments];
[task setStandardError:[NSFileHandle fileHandleWithNullDevice]];
[task setStandardOutput:[NSFileHandle fileHandleWithNullDevice]];
[task launch];
So if I want to capture the output I can simply use a file handle to a
real file and it looks like the NSTask process no longer quits.
On Wed, Jan 18, 2012 at 12:55 PM, Scott Ribe
<email@hidden> wrote:
> On Jan 18, 2012, at 11:59 AM, Andrew wrote:
>
>> I can probably find out the answer by trying different things, but I'd
>> like to get a better insight for what is going on and why the child
>> task is terminating.
>
> You may want to try LSxxxx (Launch Services) routines.
>
> --
> Scott Ribe
> email@hidden
> http://www.elevated-dev.com/
> (303) 722-0567 voice
>
>
>
>
_______________________________________________
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