From: Anatol Pomozov Date: 2006-07-16T16:45:21+09:00 Subject: Re: system() on windows Steve Martin wrote: >> >> If you want to catch all output including both STDOUT and STDERR you >> should do following trick >> >> output = `someprogram 2>&1` >> >> So using OS pipes you redirect STDERR to STDOUT and then run application >> and get STDOUT using `` function. > > 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 -- Posted via http://www.ruby-forum.com/.