Hi,

At Fri, 23 Aug 2002 07:35:38 +0900,
Jeff Putsch wrote:
> 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:

IO#eof? tries to read next data to examin EOF reached.  Use
select before eof?.

  def run_command
    stdin, out, err =  Open3.popen3("cat /etc/ifhp.conf")

    select_on = [out, err]
    while !select_on.empty? and r = select(select_on)
      p r

      r[0].each {|fh|
        if fh.eof?
          select_on.delete(fh)
          next
        elsif fh == out
          puts "out: #{fh.gets.to_s}"
        elsif fh == err
          puts "err: #{fh.gets.to_s}"
        end
      }
      $stdout.flush
    end
  end

-- 
Nobu Nakada