Commit 07b36cbf authored by simonmar's avatar simonmar

[project @ 2004-10-11 10:14:09 by simonmar]

FreeBSD-specific output no longer required
parent a13e5337
illegal operation
Action: hGetChar
Handle: {loc=<stdin>,type=semi-closed,binary=False,buffering=block (1024)}
Reason: handle is closed
File: <stdin>
illegal operation
Action: hGetChar
Handle: {loc=<stdin>,type=semi-closed,binary=False,buffering=block (1024)}
Reason: handle is closed
File: <stdin>
this line doesn't end with a newline
end of file
Action: hGetLine
Handle: {loc=<stdin>,type=readable,binary=False,buffering=block (1024)}
File: <stdin>
{loc=hGetPosn001.in,type=readable,binary=False,buffering=block (1024)} at position 0
123456789*123456789*123456789*123456789*123456789*123456789*123456789*12
1 2 3 4 5 6 7
123456789*123456789*123456789*123456789*123456789*123456789*123456789*12
1 2 3 4 5 6 7
Left illegal operation
Action: hSeek
Handle: {loc=hSeek004.out,type=writable (append),binary=False,buffering=block (1024)}
Reason: handle is not seekable
File: hSeek004.out
Left resource busy
Action: openFile
Reason: file is locked
File: readFile001.out
-- !!! readFile test
import IO
source = "readFile001.hs"
filename = "readFile001.out"
main = do
s <- readFile source
h <- openFile filename WriteMode
hPutStrLn h s
hClose h
s <- readFile filename
-- This open should fail, because the readFile hasn't been forced
-- and the file is therefore still locked.
try (openFile filename WriteMode) >>= print
putStrLn s
-- should be able to open it for writing now, because we've forced the
-- whole file.
h <- openFile filename WriteMode
print h
{loc=readFile001.out,type=writable,binary=False,buffering=block (1024)}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment