--Boundary-02WqCA6VXupBxfHq
Content-Type: text/plain;
  charsettf-8"
Content-Transfer-Encoding: quoted-printable
Content-Description: signed data
Content-Disposition: inline

On Sunday 18 January 2004 5:39 am, Ferenc Engard wrote:
> Hi all,
>
> Is there a simple way to spawn an external program, feed its stdin,
> and get its stdout?
>
> The problem with popen is, if I want to feed a few MB's of input to
> it, then it hangs (I suspect that its stdout IO buffer is full)
> before I could read out its stdout on the next line. So, the
> following do not work:
>
> io=IO.popen("externalfilter")
> io.write(verybigstring)
> result=io.read

require 'open3'
Open3.popen3("externalfilter") { |sin,sout,serr|
  sin.write(verybigstring)
  result = sout.read
}

-- 
Wesley J. Landaker - wjl / icecavern.net
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2


--Boundary-02WqCA6VXupBxfHq
Content-Type: application/pgp-signature
Content-Description: signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBACqWW8KmKTEzW49IRAnIkAJ0Vd2dbU6GPjP0O42JlmsGNTF9W7gCfchXd
OcpyAmJSdkzdgbIEsG4jdsMkY
-----END PGP SIGNATURE-----

--Boundary-02WqCA6VXupBxfHq--