[project @ 2001-08-22 11:45:06 by sewardj]
[ghc-hetmet.git] / ghc / tests / lib / IO / readFile001.stdout
1 Left resource busy
2 Action: openFile
3 Reason: file is locked
4 File: readFile001.out
5 -- !!! readFile test
6
7 import IO
8
9 source   = "readFile001.hs"
10 filename = "readFile001.out"
11
12 main = do
13   s <- readFile source
14   h <- openFile filename WriteMode
15   hPutStrLn h s
16   hClose h
17   s <- readFile filename
18
19   -- This open should fail, because the readFile hasn't been forced
20   -- and the file is therefore still locked.
21   try (openFile filename WriteMode) >>= print
22
23   putStrLn s
24
25   -- should be able to open it for writing now, because we've forced the
26   -- whole file.
27   h <- openFile filename WriteMode
28
29   print h
30
31
32 {loc=readFile001.out,type=writable,binary=False,buffering=block (8192)}