projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 2001-08-22 11:45:06 by sewardj]
[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 ()