[Haskell-cafe] Re: process

h. h._h._h._ at hotmail.com
Fri Feb 23 06:26:58 EST 2007

Donald Bruce Stewart <dons <at> cse.unsw.edu.au> writes:
> I usually use System.Process for this kind of thing.
>     http://haskell.org/ghc/docs/latest/html/libraries/base/System-Process.html

As I wrote in "process":
As long as there is no need to put some input after having received some output 
it is no problem
module Main where
import System.Process
import System.IO

main :: IO ()
main = do
        putStrLn "Running proc9..."
        (inp,out,err,pid) <- runInteractiveProcess "prog1" [] Nothing Nothing
        hSetBuffering inp LineBuffering
        hSetBuffering out LineBuffering
        hSetBuffering err LineBuffering
        hPutStrLn inp "1"
        a <- hGetLine out
        hPutStrLn inp a
        a <- hGetLine out
        waitForProcess pid
        putStrLn a

If it basically works, what goes wrong in my programm?

More information about the Haskell-Cafe mailing list