Ruby Programming/Standard Library/Open3

This is the current revision of this page, as edited by Rogerdpack (discuss | contribs) at 23:20, 18 June 2010 (Created page with 'You’ll notice there’s IO.popen but not IO.popen3. Do a require 'open3' to get that one (like Open3.popen3). The difference between popen and popen3 is that popen3 provides ...'). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

You’ll notice there’s IO.popen but not IO.popen3. Do a require 'open3' to get that one (like Open3.popen3).

The difference between popen and popen3 is that popen3 provides you access to the input and output streams of the process. Note also that if one of the pipes passed to you get written to (by the process) a lot, it might block, so you'll need to read from those streams.