4 createFile "po012.out" stdFileMode >>= \ fd ->
5 installHandler processStatusChanged (Catch (reap1 fd)) Nothing >>
10 runProcess "ls" ["-l","po012.out"] Nothing Nothing Nothing Nothing Nothing
13 getAnyProcessStatus True False >>
14 installHandler processStatusChanged (Catch (reap2 fd)) Nothing >>
15 writeChannel fd (take 666 (repeat 'x')) >>
20 getAnyProcessStatus True False >>
21 installHandler processStatusChanged (Catch (reap3 fd)) Nothing >>
22 setFileMode "po012.out"
23 (foldr1 unionFileModes [ownerReadMode,ownerWriteMode,groupReadMode,otherReadMode]) >>
28 getAnyProcessStatus True False >>
29 installHandler processStatusChanged (Catch (reap4 fd)) Nothing >>
30 setFileTimes "po012.out" 0 0 >>
35 getAnyProcessStatus True False >>
36 installHandler processStatusChanged (Catch (reap5 fd)) Nothing >>
37 removeLink "po012.out" >>
42 getAnyProcessStatus True False >>
43 seekChannel fd SeekFromEnd 0 >>= \ bytes ->
45 seekChannel fd AbsoluteSeek 0 >>
46 readChannel fd 1024 >>= \ (str, _) ->
47 if str == (take 666 (repeat 'x')) then
50 putStr "Read failed\n"
52 putStr "Seek returned wrong size\n"