site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=diSiiA7y86OnppZl2YMR2Nbc/95/IykKsAdrZoKgpJaxMSnPe7QLLediT3Hu6GNYzrfqfMX0nyfKJFeMWB3cgVlnJXQFouU7hlLayuwurdpUhdYe7KW5wA4aQw3+QQNQvFMIf2qtUqLa/rdCSeoXjnqcNUgxXfP0kID4TD3b4QA= On 9/30/05, Matthew Jaffa <mtjaffa@msn.com> wrote:
Here is my problem:
App1 calls App2 and App2 calls App3, now App2 depends on the return codes of App3. 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???
Just so it's clear: No re-routing of stdout is happening in any of this right now? By "return code" you mean "what's written to App3's stdout" and not what is returned from main? if so, App1, App2, and App3 all have the same stdout. If you want App2 to capture the stdout and be the provider of stdin for App3 I'd suggest using a pipe. I'm unfamiliar with using pipe's with the Foundation API, but here's a guess how: let thePipe = a NSPipe. let app3Task = the NSTask for App3 [app3Task setStandardOutput: [thePipe fileHandleForWriting]] Then the parent process can read from App3's stdout using [thePipe fileHandleForReading] If, however, you just want the return code returned by App3's main... That's unrelated to stdout. -- -Corey O'Connor _______________________________________________ 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... This email sent to site_archiver@lists.apple.com