From: Urabe Shyouhei Date: 2010-03-10T06:31:32+09:00 Subject: Re: Capturing incremental output from STDOUT --------------enigEA9ACECADF4035F5DB6F01C1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable James Coglan wrote: > Hi all, >=20 > If I run an external process, e.g. >=20 > IO.popen('cucumber') >=20 > Then Ruby blocks while waiting for the whole output of the subprocess. really? irb(main):001:0> IO.popen("yes yes") do |fp| irb(main):002:1* loop do irb(main):003:2* puts Time.now irb(main):004:2> fp.gets irb(main):005:2> sleep 1 irb(main):006:2> end irb(main):007:1> end Wed Mar 10 06:30:25 +0900 2010 Wed Mar 10 06:30:26 +0900 2010 Wed Mar 10 06:30:27 +0900 2010 Wed Mar 10 06:30:28 +0900 2010 Wed Mar 10 06:30:29 +0900 2010 Wed Mar 10 06:30:30 +0900 2010 =2E.. Seems it do not wait the EOF. --------------enigEA9ACECADF4035F5DB6F01C1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkuWvi8ACgkQuTXPUnA5eMLXvACfTUKSlIz7rwZslb/rm+6mfNrU mjkAnRkOjmINcG4wpJvAdMc75Dzt7gAv =pWjQ -----END PGP SIGNATURE----- --------------enigEA9ACECADF4035F5DB6F01C1--