bb3518c440fe54dc9ab39b0c6f3e83bd1a388681
[ghc-hetmet.git] / ghc / tests / lib / posix / posix014.hs
1 --!! Basic pipe usage
2 module Main(main) where
3
4 import Posix
5
6 main = do
7   str <- getEffectiveUserName
8   putStrLn str
9   (rd, wd) <- createPipe
10   n <- forkProcess
11   case n of
12     Nothing  -> do
13        (str,_) <- fdRead rd 32
14        -- avoid them zombies
15        putStrLn str
16     Just pid -> do
17        fdWrite wd "Hi, there - forked child calling" 
18 --       getProcessStatus False True pid
19        return ()