"Sigbjorn Finne (Intl Vendor)" wrote:
> 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.)

OK, then ghc-bugs is the wrong list.  :-}  Hugs98 runs the example
*without* any complaints, which should count as a bug...

Cheers,
   Sven
-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne

Reply via email to