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.
17 try (openFile filename WriteMode) >>= print
21 -- should be able to open it for writing now, because we've forced the
23 h <- openFile filename WriteMode