How do I pipe the stdout and stderr of a process to the same Handle? On unix systems it's pretty easy, just use createPipe
and pass the write end to runProcess
as both stdout and stderr. On Windows it's harder:
Neither the unix-compat nor the Win32 package export a way to create pipes.
openTempFile
(which could be use to simulate pipes) sets the wrong mode on the createdHandle
.
Edit: To give some more context: I want to run a process and have it write its stdout and stderr to the same Handle
, in a cross-platform manner.
openTempFile
'sHandle
is created withReadWrite
permission, which ought to be enough for another process (run by the same user) to write to it. – Daniel Wagner