From: Brian Candler Date: 2003-05-13T03:02:09+09:00 Subject: Re: RCR for child execution On Tue, May 13, 2003 at 12:23:17AM +0900, Simon Strandgaard wrote: > Im trying to make it easier to embed ruby into existing C/C++ > applications. I think this issue is very important in order to get Ruby more > widespread. Well, as you probably know, my vote is strongly against. Ruby embeds very well at the moment, thank you very much. If you want a version of Ruby's "system" command which captures stderr/stdout into a string, you can write your own easily. I suggested the shorthand %X{command} to run a command and capture both stdout and stderr into a string (the RCR from which this thread gets its subject) But trying to intercept all stdout/stderr of a portion of your program (i.e. the Ruby part) in general requires you either to change stdout/stderr and restore it afterwards, or to fork and change it to a pipe, because the "Ruby" part may write directly to the underlying stdout/stderr, not to $stdout or $defout. I really cannot see where the problem lies. We could play this game all day: you give me an example where you think it would be useful for Ruby to have this magic, and I can show how you can do it without. Brian.