A version of
readCreateProcessWithExitCode that communicates
with the child process through a pair of
CommunicationHandles.
Example usage:
readCreateProcessWithExitCodeCommunicationHandle
(\(chTheyRead, chTheyWrite) -> proc "child-exe" [show chTheyRead, show chTheyWrite])
(\ hWeRead -> hGetContents hWeRead)
(\ hWeWrite -> hPut hWeWrite "xyz")
where
child-exe is a separate executable that is implemented
as:
main = do
[chRead, chWrite] <- getArgs
hRead <- openCommunicationHandleRead $ read chRead
hWrite <- openCommunicationHandleWrite $ read chWrite
input <- hGetContents hRead
hPut hWrite $ someFn input
hClose hWrite