
5 Jul
2007
5 Jul
'07
3:04 p.m.
Dougal Stanton wrote:
do (hin, hout, herr, ph) <- runInteractiveProcess cmd args Nothing Nothing forkIO $ hPutStr hin content >> hClose hin out <- hGetContents hout return (ph, out)
which seems to require threading. If I compile without, it will hang indefinitely, I presume deadlocked. Is there a way this can be done without threading?
With much sweat, you could write your own timed polling loop and avoid threads, using hPutBufNonBlocking and hGetBufNonBlocking. I don't recommend it, except for fun or self-torture.