I don't see the point in this solution. Aren't the two
opens supposed to spawn two different subprocesses? In this way, you're getting the stdout from one of them and stderr from the other, but probably you don't want to do that double work (not counting that the two processes could collide, have different behaviours and outcomes, etc etc).
But it's highly probable that I'm missing something about some interaction from the two opens :(
Flavio.