From: Jeff Putsch Date: 2002-08-23T07:35:38+09:00 Subject: Why does this hang? Howdy, I've got a simple test routine using Open3.popen3 and it hangs when checking for EOF on the stderr IO object that Open3.popen3 returns. Here's the simple program: def run_command stdin, out, err = Open3.popen3("cat /etc/ifhp.conf") while not out.eof? and not err.eof? select_on = [] select_on.push(out) unless out.eof? select_on.push(err) unless err.eof? r = select(select_on) p r r[0].each { |fh| if fh == out puts "out: #{fh.gets.to_s}" end if fh == err puts "err: #{fh.gets.to_s}" end } $stdout.flush end end run_command When I run this, it hangs at the "while not ..." line. If I don't check for "err.eof?", then it never hangs. I don't understand what is going on. Any help/guidance/suggestions will be greatly appreciated. Jeff. -- Jeff Putsch Email: putsch@mxim.com Maxim Integrated Products Office: (503)547-2037 High Frequency CAD Engineering