[Haskell-cafe] Strange behaviour with writeFile
u.stenzel at web.de
Sun Feb 4 14:29:14 EST 2007
> I've found that:
> let (answer2, remainder) = parseAnswer (force answer)
> force :: Eq a => a -> a
> force x = if x==x then x else x
> Seems to do the trick.
...but I'd advise against using it. If the power fails at the right
time, you're left with no file at all. It's probably better to simply
write a new file and rename it over the old one at the end. That is
safer and doesn't require you to jump through hoops. If you can't
afford the disk space to do that, you want a full-blown database anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070204/c1280a04/attachment.bin
More information about the Haskell-Cafe