Created
April 26, 2011 17:56
-
-
Save kwerle/942749 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require "open4" | |
require "stringio" | |
require "ruby-debug" | |
Open4::popen4("./muchoutput") 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 "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment