In ruby18 I sometimes did the following to get a subprocess with full control:
stdin, @stdin= IO.pipe
@stdout, stdout= IO.pipe
@stderr, stderr= IO.pipe
@pid= fork do
@stdin.close
STDIN.close
stdin.dup
@stdout.close
STDOUT.close
stdout.dup
@stderr.close
STDERR.close
stderr.dup
exec(...)
end
This does not work in ruby19. The close method for STDIN, STDOUT, STDERR does not close the underlying filedescriptor in ruby19. How do I do this in ruby19.