Sha256: 9a5ac4dd9786614181bc49de4e728ae27ebecbed00c2d7073adbaac590af0f45

Contents?: true

Size: 342 Bytes

Versions: 35

Compression:

Stored size: 342 Bytes

Contents

require 'yaml'
require 'open4'
include Open4

stdin = '42'
stdout = ''
stderr = ''

t = bg 'ruby -e"sleep 4; puts ARGF.read"', 0=>stdin, 1=>stdout, 2=>stderr

waiter = Thread.new{ y t.pid => t.exitstatus } # t.exitstatus is a blocking call!

while((status = t.status))
  y "status" => status
  sleep 1
end

waiter.join

y "stdout" => stdout

Version data entries

35 entries across 35 versions & 4 rubygems

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