5 createFile "po012.out" stdFileMode >>= \ fd ->
6 installHandler processStatusChanged (Catch (reap1 fd)) Nothing >>
11 runProcess "ls" ["-l","po012.out"] Nothing Nothing Nothing Nothing Nothing
14 getAnyProcessStatus True False >>
15 installHandler processStatusChanged (Catch (reap2 fd)) Nothing >>
16 writeChannel fd (take 666 (repeat 'x')) >>
21 getAnyProcessStatus True False >>
22 installHandler processStatusChanged (Catch (reap3 fd)) Nothing >>
23 setFileMode "po012.out"
24 (foldr1 unionFileModes [ownerReadMode,ownerWriteMode,groupReadMode,otherReadMode]) >>
29 getAnyProcessStatus True False >>
30 installHandler processStatusChanged (Catch (reap4 fd)) Nothing >>
31 setFileTimes "po012.out" 0 0 >>
36 getAnyProcessStatus True False >>
37 installHandler processStatusChanged (Catch (reap5 fd)) Nothing >>
38 removeLink "po012.out" >>
43 getAnyProcessStatus True False >>
44 seekChannel fd SeekFromEnd 0 >>= \ bytes ->
46 seekChannel fd AbsoluteSeek 0 >>
47 readChannel fd 1024 >>= \ (str, _) ->
48 if str == (take 666 (repeat 'x')) then
51 putStr "Read failed\n"
53 putStr "Seek returned wrong size\n"