On Sun, 19 Jan 2003 17:19:52 +0000 Glynn Clements <[EMAIL PROTECTED]> wrote:
> > > Just omit the hClose; hGetContents will automatically close the > handle once all of the data has actually been read. See §11.2.1 of > the library report for details. Thanks for this pointer. Quoting from the report: A semi-closed handle becomes closed: * if hClose is applied to it; * if an I/O error occurs when reading an item from the file item from the stream; * or once the entire contents of the file has been read. What happens if one does NOT read the whole contents, but there are no more references to the results of hGetContents? Is the file handle closed anyway ? Here's an example of what I mean: openFile n ReadMode >>= hGetContents >>= return . (take 10) Vincenzo -- First they ignore you, then they laugh at you, then they fight you, then you win. [Gandhi] _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell