summaryrefslogtreecommitdiff
path: root/libraries/base/tests/IO/concio002.hs
blob: 60a2ed2a89f6c8998cb5a8e87b8430c4fb009a72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import System.Process
import System.IO
import Control.Concurrent

main = do
  (hin,hout,herr,ph) <- runInteractiveProcess "cat" [] Nothing Nothing
  forkIO $ do threadDelay 100000
              putStrLn "child"
              hFlush stdout
              hPutStrLn hin "msg"
              hFlush hin
  putStrLn "parent1"
  hGetLine hout >>= putStrLn
  putStrLn "parent2"