From: Sky Yin Date: 2006-01-04T10:58:18+09:00 Subject: Re: Help on I/O pipe ------=_Part_32584_19869253.1136339883726 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline It works very smoothly now. Thanks a lot for the timely help. Everyday I love ruby a bit more :^) On 1/3/06, ara.t.howard@noaa.gov wrote: > > On Wed, 4 Jan 2006, Sky Yin wrote: > > > Thank Yohanes for the detailed explanation. I've just tried using > > > > io =3D IO.popen("optimizer.exe", "r+") > > io.puts "..." #stdin > io.gets #stdout > > ... > > io.close > > > > It's weird that first two io.gets worked OK to retrieve the first two > lines > > of the result, but then io.gets halted on the third io.gets. No clue. > > > > As for the session gem, I installed, but require 'session' simply > returns a > > false under Win32. > > > > Thanks anyway. > > session is not going to work under win32. you'll need to do something > like > > io =3D IO.popen("optimizer.exe", "r+") > > io.puts "..." # stdin > io.close_write > > stdout =3D io.read > > io.close > > to avoid hanging on a gets with line buffered output. > > regards. > > -a > -- > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > | ara [dot] t [dot] howard [at] noaa [dot] gov > | all happiness comes from the desire for others to be happy. all misery > | comes from the desire for oneself to be happy. > | -- bodhicaryavatara > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > -- Blog >>> http://spaces.msn.com/members/skyincookoo ------=_Part_32584_19869253.1136339883726--