From: "Iñaki Baz Castillo" Date: 2010-01-12T06:27:48+09:00 Subject: Re: redirecting output ruby and from stdout results in blank file El Lunes, 11 de Enero de 2010, Jonathan Nielsen escribió: > > When I remove the redirection, I see all of the output that I expect. > > However, when I execute the above lines, only std_err has content, > > while std_out has nothing. The output being collected is standard > > printfs in a modified version of WebKit, if that's relevant. > > It's possible that I'm misinterpreting what you want here, but you may > want to look into the function popen3: > > http://ruby-doc.org/stdlib/libdoc/open3/rdoc/index.html > > It let's you specify what to do with the stdin, stdout, and stderr streams. I recommend popen4 as it also gets the correct exit status code of the executed command. -- Iñaki Baz Castillo