5 source = "readFile001.hs"
6 filename = "readFile001.out"
10 h <- openFile filename WriteMode
13 s <- readFile filename
15 -- This open should fail, because the readFile hasn't been forced
16 -- and the file is therefore still locked. But GHC currently has a
17 -- bug in that the openFile truncates the file before checking
18 -- whether it was locked or not.
19 -- r <- try (openFile filename WriteMode)
24 -- should be able to open it for writing now, because we've forced the
26 h <- openFile filename WriteMode
31 {loc=readFile001.out,type=writable,binary=False,buffering=block (8192)}