Hi,

I need to read the output from a subprocess (binary, not ruby) from within a
ruby script.

Usually I'd just use the  or the popen functions, but under some
circumstances the sub process can hang and needs to be killed. 

I did not find any proper way to get the pid of such a subprocess yet, so
I'd do the usual Unix steps

  Socket.pair   - fork   -   copy socket to fd 1  - exec 

myself from ruby. Then I have the child pid in the parent process and can
send a kill after some timeout.


But: How can I modify the fd 1 (=STDOUT) before exec in order to have the
subprocess use that pipe?



regards
Hadmut