From: S Wayne Date: 2006-07-16T17:30:05+09:00 Subject: Re: system() on windows I stand corrected. I did try it, but got it twisted up. Yet more evidence that Windows has moved closer to a Unix syntax for the command shell. Handy to know if I ever end up doing development on Windows. > Steve Martin wrote: > > Except that the OP said he is on Windows, and unless he is using cygwin > > to get bash/sh style redirection, that won't work. Starndard Error > > isn't captured by any of the ruby IO/Exec processes that I can find. > > Did you really try my recipe on Windows? > > File.open('a.rb','w'){|f| > f.write <<-END > STDOUT.puts 'standard output stream' > STDERR.puts 'error output stream' > END > } > > out = `ruby a.rb 2>&1` > > puts "HERE IT IS OUTPUT:" > puts out > > =====OUTPUT===== > HERE IT IS OUTPUT: > standard output stream > error output stream >