nobu.nokada / softhome.net wrote:
>   require 'pty'
>   PTY.spawn("./plok") do |r, w|
>     r.each do |line|
>       puts("==> #{l}")
>     end
>   end
> 

Thank you very much !

I have updated the code a little bit, because r.each() seems to throw a 
RuntimeError exception ("Child_changed: X") when the process dies.

require 'pty'
PTY.spawn("./plok") do |r, w|
     begin
         r.each do |line|
             puts("==> #{line}")
         end
     rescue RuntimeError => err
         raise unless err.message =~ /Child_changed/
     end
end

--
Laurent