Sha256: a57089c73e5db131f5939809a8d8f3e96b9200f6ea36793718c7d026d473bcf8

Contents?: true

Size: 472 Bytes

Versions: 37

Compression:

Stored size: 472 Bytes

Contents

require 'open4'
#
# when using block form the child process is automatically waited using
# waitpid2
#

status =
  Open4::popen4("sh") do |pid, stdin, stdout, stderr|
    stdin.puts "echo 42.out"
    stdin.puts "echo 42.err 1>&2"
    stdin.close

    puts "pid        : #{ pid }"
    puts "stdout     : #{ stdout.read.strip }"
    puts "stderr     : #{ stderr.read.strip }"
  end

    puts "status     : #{ status.inspect }"
    puts "exitstatus : #{ status.exitstatus }"

Version data entries

37 entries across 37 versions & 4 rubygems

Version Path
ahoward-open4-1.0.0 samples/block.rb
open4-1.3.4 samples/block.rb
open4-1.3.3 samples/block.rb
open4-1.3.2 samples/block.rb
open4-1.3.1 samples/block.rb
open4-1.3.0 samples/block.rb
open4-1.2.0 samples/block.rb
open4-1.1.0 samples/block.rb
crazy_ivan-1.2.4 lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb
crazy_ivan-1.2.3 lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb
crazy_ivan-1.2.2 lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb
crazy_ivan-1.2.1 lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb
crazy_ivan-1.2.0 lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb
crazy_ivan-1.1.1 lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb
crazy_ivan-1.1.0 lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb
crazy_ivan-1.0.0 lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb
ginst-2009.12.8 vendor/gems/open4-1.0.1/samples/block.rb
ginst-2009.11.24 vendor/gems/open4-1.0.1/samples/block.rb
ginst-2009.11.23 vendor/gems/open4-1.0.1/samples/block.rb
ginst-2.0.1 vendor/gems/open4-1.0.1/samples/block.rb