Skip to content

Instantly share code, notes, and snippets.

@mynameisrufus
Created November 8, 2010 21:59
Show Gist options
  • Save mynameisrufus/668349 to your computer and use it in GitHub Desktop.
Save mynameisrufus/668349 to your computer and use it in GitHub Desktop.
Hubris Open4 example
def self.noisy(str)
pid, stdin, stdout, stderr = Open4.popen4 str
puts "running #{str}\n"
# puts "Status: #{status.exitstatus}"
# puts "#{pid} done"
msg =<<-"EOF"
ran |#{str}|
output|#{stdout.read}|
error |#{stderr.read}|
EOF
ignored, status = Process.waitpid2 pid
msg += "status |#{status}|"
return status, msg
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment