Sven Panne <[EMAIL PROTECTED]> writes: 
> 
...
>    * hClose on a semi-closed handle fails (4.02 has this bug, too):
> 
>         import IO
>         main = do
>            h <- openFile "/etc/passwd" ReadMode
>            c <- hGetContents h
>            putStr c
>            hClose h
> 
>      Transcript:
> 
>         root:x:0:0:root:/root:/bin/bash
>         bin:x:1:1:bin:/bin:/bin/bash
>         [...]
>         Fail: illegal operation
>         Action: hClose
>         Handle: {closed}
>         Reason: handle is closed
> 
>      According to the library report, closing a semi-closed handle
>      should be allowed.
> 

But that's not the case here. By the time you get around to doing
the 'hClose', you've read to the end of the file and the semi-closed
handle has been closed for you (cf. report.)

--Sigbjorn

Reply via email to