Re: Spawn process without inheriting parent stdout, stdin
Re: Spawn process without inheriting parent stdout, stdin
- Subject: Re: Spawn process without inheriting parent stdout, stdin
- From: Sherm Pendley <email@hidden>
- Date: Fri, 30 Sep 2005 18:50:44 -0400
On Sep 30, 2005, at 6:28 PM, Matthew Jaffa wrote:
App1 calls App2 and App2 calls App3, now App2 depends on the
return codes of App3.
Note that return code is an entirely different animal - that's the
integer value that's returned from main(). It has nothing to do with
what's printed to stdout or stderr. You can access it with NSTask's -
terminationStatus.
But somehow App2 is always getting the same return code because
maybe App1 is swallowing up App3's ouput since he is the overall
parent of all of them. App2 needs to capture App3's stdout but for
some reason it seems to be not returning correctly.
Am I making any sense here???
Sorry, but "it seems to be not returning correct" is far too vague to
answer with more than a guess.
By default, if you don't override it, App2 will inherit stdout from
App1, and App3 will inherit stdout from App2. But, it's trivial to
override that default; if you want to capture App3's output, you
simply create an NSPipe in App2 and pass that to NSTask's -
setStandardOutput: before launching App3.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden