5 createFile "po012.out" stdFileMode >>= \ fd ->
6 installHandler processStatusChanged (Catch (reap1 fd)) Nothing >>
11 runProcess "ls" ["-l"] Nothing Nothing Nothing Nothing Nothing
14 hPutStrLn stderr "Reaper1" >>
15 getAnyProcessStatus True False >>
16 installHandler processStatusChanged (Catch (reap2 fd)) Nothing >>
17 fdWrite fd (take 666 (repeat 'x')) >>
22 hPutStrLn stderr "Reaper2" >>
23 getAnyProcessStatus True False >>
24 installHandler processStatusChanged (Catch (reap3 fd)) Nothing >>
25 setFileMode "po012.out"
26 (foldr1 unionFileModes [ownerReadMode,ownerWriteMode,groupReadMode,otherReadMode]) >>
31 hPutStrLn stderr "Reaper3" >>
32 getAnyProcessStatus True False >>
33 installHandler processStatusChanged (Catch (reap4 fd)) Nothing >>
34 setFileTimes "po012.out" 0 0 >>
39 hPutStrLn stderr "Reaper4" >>
40 getAnyProcessStatus True False >>
41 installHandler processStatusChanged (Catch (reap5 fd)) Nothing >>
42 --removeLink "po012.out" >>
47 hPutStrLn stderr "Reaper5" >>
48 getAnyProcessStatus True False >>
49 fdSeek fd SeekFromEnd 0 >>= \ bytes ->
51 fdSeek fd AbsoluteSeek 0 >>
52 hPutStrLn stderr "Reaper5" >>
53 fdRead fd 666 >>= \ (str, _) ->
54 if str == (take 666 (repeat 'x')) then
57 putStr "Read failed\n"
59 putStr "Seek returned wrong size\n"