Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spawn process without inheriting parent stdout, stdin



On 9/30/05, Corey O'Connor <email@hidden> wrote:
> 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]

Cancel that! Even easier apparantly:

let thePipe = a NSPipe.
let app3Task = the NSTask for App3
[app3Task setStandardOutput: thePipe] // note: does not pass the pipes
write file handle.

Then the parent process can just use [thePipe fileHandleForReading] to
read from the child-process' stdout.

--
-Corey O'Connor
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Spawn process without inheriting parent stdout, stdin (From: Sherm Pendley <email@hidden>)
 >Re: Spawn process without inheriting parent stdout, stdin (From: "Matthew Jaffa" <email@hidden>)
 >Re: Spawn process without inheriting parent stdout, stdin (From: "Corey O'Connor" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.