From: Paul Brannan Date: 2007-09-05T06:57:59+09:00 Subject: Re: [C ext to Ruby] returning a pipe ??? On Wed, Sep 05, 2007 at 02:35:10AM +0900, unbewusst wrote: > then i wonder if there is a way somehow to return the > "myCommunicationsPipe" above directly (more directly) from C to ruby. > > something like IO.popen... I see at least two options: - Use the macros in rubyio.h to wrap the FILE* that you already have. This is "cheating" the ruby API a bit, since you'd be accessing structures that I don't think Matz intended for us to access directly. - Use IO#fdopen to re-open the pipe once it is opened. Paul