Module Open3
In: lib/open3.rb

Open3 grants you access to stdin, stdout, and stderr when running another program. Example:

  require "open3"
  include Open3

  stdin, stdout, stderr = popen3('nroff -man')

Open3.popen3 can also take a block which will receive stdin, stdout and stderr as parameters. This ensures stdin, stdout and stderr are closed once the block exits. Example:

  require "open3"

  Open3.popen3('nroff -man') { |stdin, stdout, stderr| ... }

Methods

popen3  

Public Instance methods

Open stdin, stdout, and stderr streams and start external executable. Non-block form:

  require 'open3'

  [stdin, stdout, stderr] = Open3.popen3(cmd)

Block form:

  require 'open3'

  Open3.popen3(cmd) { |stdin, stdout, stderr| ... }

The parameter cmd is passed directly to Kernel#exec.

[Validate]

ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.