module Open3

Module Open3 supports creating child processes with access to their $stdin, $stdout, and $stderr streams.

What’s Here

Each of these methods executes a given command in a new process or subshell, or multiple commands in new processes and/or subshells:

  • Each of these methods executes a single command in a process or subshell, accepts a string for input to $stdin, and returns string output from $stdout, $stderr, or both:

    • Open3.capture2: Executes the command; returns the string from $stdout.

    • Open3.capture2e: Executes the command; returns the string from merged $stdout and $stderr.

    • Open3.capture3: Executes the command; returns strings from $stdout and $stderr.

  • Each of these methods executes a single command in a process or subshell, and returns pipes for $stdin, $stdout, and/or $stderr:

    • Open3.popen2: Executes the command; returns pipes for $stdin and $stdout.

    • Open3.popen2e: Executes the command; returns pipes for $stdin and merged $stdout and $stderr.

    • Open3.popen3: Executes the command; returns pipes for $stdin, $stdout, and $stderr.

  • Each of these methods executes one or more commands in processes and/or subshells, returns pipes for the first $stdin, the last $stdout, or both:

Each of the methods above accepts:

Ruby Core © 1993–2024 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.