From: Gilles Filippini Date: 2002-07-14T07:40:40+09:00 Subject: IO.pipe trick ? Hi all, I need someone shed some light on the following problem. Here is the culprit script: #-------------------------- output = IO.pipe old_out = $defout.dup old_out.sync = true $defout = output[1] thread = Thread.new { old_out.puts("@@@@ 1") while not output[0].eof? old_out.puts("@@@@ 2") select([output[0]]) old_out.write(output[0].read) end output[0].close } puts `cat #{ARGV[0]}` output[1].close thread.join #-------------------------- Try this script with a text file for the first argument: - if the file's size is less than - say - 8 ko, the script works fine. - if the file's size is more than - say - 10 ko, ruby hangs on the while statement. What could be the reason for this behavior ? Thanks in advance. _gilles.