
simple exe bytes args = do (i, o, e, p) <- runInteractiveProcess exe args Nothing Nothing hPut i bytes s <- hGetContents o hClose i return s
Yep, that's your problem. forkIO the hPut.
Maybe I didn't do enough here -- just wrapping in `forkIO` does not seem to actually help. -- _jsn import Data.ByteString.Lazy import System.Process import System.Environment import System.IO (hClose) import Control.Concurrent import Prelude hiding (writeFile, readFile) main = do exe:file:_ <- getArgs bytes <- readFile file foo <- simple exe bytes [] writeFile (file ++ ".foo") foo -- Manufactures a simple stream handler from a command line utility. simple :: String -> ByteString -> [String] -> IO ByteString simple exe bytes args = do (i, o, e, p) <- runInteractiveProcess exe args Nothing Nothing forkIO $ hPut i bytes s <- hGetContents o return s