[Haskell-beginners] File I/O: reading from, writing to, same file in one function

Chaddaï Fouché chaddai.fouche at gmail.com
Thu Feb 5 21:33:11 UTC 2015


On Thu, Feb 5, 2015 at 10:30 PM, Geoffrey Bays <charioteer7 at gmail.com>
wrote:

> Francesco:
>
> Unfortunately, using withFile I get the same error as before with handles:
> hPutStr: illegal operation (handle is closed).
>
>
This error suggests you're forgetting to reopen your file in WriteMode once
withFile closed it (you *did *read the documentation of withFile ?). Trying
to write on a closed handle is an exercise in futility.

-- 
Jedaï
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20150205/dd7e3827/attachment.html>


More information about the Beginners mailing list