S
S
Splite2014-03-11 22:07:59
ruby
Splite, 2014-03-11 22:07:59

Ruby - how to redirect to standard input / output streams?

Hello! There are STDIN, STDOUT, STDERR streams received from an external application.

stdin, stdout, stderr, wait_thr = Open3.popen3('cmd')

How can I redirect them to the standard $stdin, $stdout and $stderr?
I tried $stderr.reopen stderrbut I get
<STDIN> can't change access mode from "r" to "w" (ArgumentError)

I need to implement something like screen to store streams from different applications and easily switch between them

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question