mswin32ってパイプ使えましたっけ? # IO#tee # redirect to argument object(s), still output to original require 'thread' class IO def tee(*a) a << dup r, w = IO.pipe self.reopen(w) Thread.start(r, w, a) do |r, w, a| buf = sprintf("%4096s", '') begin loop do r.readpartial(4096, buf) Thread.exclusive { a.each {|i| i.write buf } } end rescue EOFError # ok, end of input Thread.exclusive { a.each {|i| i.write buf } } end end self end end