[Haskell-cafe] How to waitForProcess?
eleventynine at gmail.com
Wed Sep 5 06:39:00 CEST 2012
You might have to use hGetContents, then waitForProcess, and then
terminateProcess -- you can then check if the process is indeed terminated
On Wed, Sep 5, 2012 at 1:45 PM, Magicloud Magiclouds <
magicloud.magiclouds at gmail.com> wrote:
> 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 -> do
> (_, Just o, _, h) <- createProcess $ CreateProcess (RawCommand
> "/usr/bin/flow-export" ["-f2"]) Nothing Nothing (UseHandle i)
> CreatePipe Inherit True False
> hGetContents o
> return $ tail $ lines csv_
> And for G+, please use magiclouds#gmail.com.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe