Re: Spawn process without inheriting parent stdout, stdin
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com On Sep 30, 2005, at 6:28 PM, Matthew Jaffa wrote: 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 (Cocoa-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.apple... 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Sherm Pendley