
13 Feb
2009
13 Feb
'09
10:38 a.m.
Hi, I want to run multiple programs and dump the stdout/stderr to a file, I've tried doing: h <- openFile file WriteMode let c = CreateProcess (RawCommand file []) Nothing Nothing Inherit (UseHandle h) (UseHandle h) False (_,_,_,pid) <- createProcess c waitForProcess pid hPutStrLn h "Test" But by the time I get to the hPutStrLn line it says: Main: test.log: hPutStr: illegal operation (handle is closed) What have I done wrong? Did createProcess close the handle, and is there a way round this? This is using GHC 6.10 on Windows with the new process-1.0.1.1 Thanks Neil