[Haskell-cafe] How to waitForProcess?

2012-09-04 Thread Magicloud Magiclouds
Hi, I have code like this and it leaves lots of zombies of flow-export. Then I add waitForProcess Well I do not know where to put it. Before or after 'hGetContents' both make the program hung. exportCSV :: FilePath - IO [String] exportCSV file = do csv_ - withBinaryFile file ReadMode $ \i

Re: [Haskell-cafe] How to waitForProcess?

2012-09-04 Thread Ivan Lazar Miljenovic
On 5 September 2012 13:45, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: Hi, I have code like this and it leaves lots of zombies of flow-export. Then I add waitForProcess Well I do not know where to put it. Before or after 'hGetContents' both make the program hung. You're

Re: [Haskell-cafe] How to waitForProcess?

2012-09-04 Thread Mike Ledger
You might have to use hGetContents, then waitForProcess, and then terminateProcess -- you can then check if the process is indeed terminated using getProcessExitCode. On Wed, Sep 5, 2012 at 1:45 PM, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: Hi, I have code like this and it

Re: [Haskell-cafe] How to waitForProcess?

2012-09-04 Thread Magicloud Magiclouds
Forgot about that, just read 'readProcess' code to figure out. Thanks. On Wed, Sep 5, 2012 at 12:37 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 5 September 2012 13:45, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: Hi, I have code like this and it leaves lots

Re: [Haskell-cafe] How to waitForProcess?

2012-09-04 Thread Brandon Allbery
On Tue, Sep 4, 2012 at 9:39 PM, Mike Ledger eleventyn...@gmail.com wrote: You might have to use hGetContents, then waitForProcess, and then terminateProcess -- you can then check if the process is indeed terminated using getProcessExitCode. Er? When waitForProcess returns the process is