shuyo #775(2007/07/13 17:04 GMT) [ Ruby ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
def pipe(f, g, th=nil) while line = g.gets f.puts line end th.exit if th end cmd1, cmd2 = ARGV f1 = IO.popen(cmd1, "r+") f2 = IO.popen(cmd2, "r+") begin th1 = Thread.new { pipe f1, f2 } th2 = Thread.new { pipe f2, f1, th1 } th1.join rescue end
Rating0/0=0.00-0+
[ reply ]
shuyo
#775()
[
Ruby
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]