[Haskell-cafe] Automatic file closing after readFile

Magnus Therning magnus at therning.org
Thu Oct 18 08:18:56 EDT 2007


On Thu, Oct 18, 2007 at 12:05:40 +0100, Jules Bean wrote:
>>Is there some (easy) way to avoid this while still using readFile?
>
>readFile' f = do s <- readFile f
>		 return (length s `seq` s)
>
>(and curse the fact that the default readFile is unsafelazy).

:( Doesn't work.  I'm starting to suspect there is no automatic close of
opened files even after they've been completely read.

/M

-- 
Magnus Therning                             (OpenPGP: 0xAB4DFBA4)
magnus@therning.org             Jabber: magnus.therning@gmail.com
http://therning.org/magnus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071018/0dd3a2e2/attachment.bin


More information about the Haskell-Cafe mailing list