Hi,

In message "Re: [ruby-core:19583] [Bug #694] eof? call on a pty IO object causes application to exit"
    on Wed, 29 Oct 2008 08:10:13 +0900, Dave Thomas <redmine / ruby-lang.org> writes:

|dave[RUBY3/Book 18:08:15*] cat t.rb
|
|require 'pty'
|
|PTY.spawn("/usr/bin/ruby /usr/bin/irb") do |reader, writer, pid|
|  reader.eof?
|end  
|
|dave[RUBY3/Book 18:08:52*] ruby -v t.rb
|
|ruby 1.9.0 (2008-10-29 revision 15427) [i386-darwin9.5.0]
|t.rb:4:in `eof?': pty - exited: 82527 (PTY::ChildExited)
|	from t.rb:4:in `block in <main>'
|	from t.rb:3:in `spawn'
|	from t.rb:3:in `<main>'
|
|This problem prevents expect() from working.

pty uses exceptions to notify the process exit.  In my case, it
terminated because I don't have /usr/bin/irb installed (it's renamed
to /usr/bin/irb1.8).

What do you expect?  Checking eof without raising exception?

							matz.