Skip to content

Instantly share code, notes, and snippets.

@kwerle
Created April 26, 2011 17:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwerle/942749 to your computer and use it in GitHub Desktop.
Save kwerle/942749 to your computer and use it in GitHub Desktop.
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