From: Payton Swick Date: 2006-01-31T04:24:38+09:00 Subject: IO.popen hangs reading an empty pipe? How does one check a pipe (created using IO.popen) to see if there is input waiting without using IO#eof or reading from the pipe? Doing either of these seems to hang forever if the pipe is empty. Here's an example: require 'timeout' IO.popen("cat", "r+") do |pipe| # pipe.puts "hello world" # Uncomment this to prevent hang below. Timeout::timeout(2) do if not pipe.eof? # This will hang if the pipe is empty. p pipe.getc end end end -Payton