[Haskell-cafe] runInteractiveCommand: program ends before writing or reading all the output

Philip Weaver philip.weaver at gmail.com
Thu May 15 14:54:10 EDT 2008


On Thu, May 15, 2008 at 11:42 AM, Ronald Guida <oddron at gmail.com> wrote:
> It looks like a simple race condition to me.  You are using
> "waitForProcess pid" to wait for runInteractiveCommand to finish, but
> you don't seem to have anything that waits for createDefFile to
> finish.
>
Whoops, sorry, I didn't read the original post closely enough.
>> main :: IO ()
>> main = do
>>   (file:_) <- getArgs
>>   (_, out, _, pid) <- runInteractiveCommand $ "dumpbin /EXPORTS " ++ file
>>   forkIO (createDefFile file out)
>>   waitForProcess pid
>>   hClose out
>>   hFlush stdout
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list