<div dir="ltr"><div>Perfect, thanks! I will try switching over to use unliftio. Assuming it meets my needs --- and I see no reason why it won't --- I withdraw my intention to take over cautious-file.</div><div><br></div><div>-Brent<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 13, 2020 at 10:43 AM Niklas Hambüchen <<a href="mailto:mail@nh2.me">mail@nh2.me</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Tangentially, note that `cautious-file` has drawbacks:<br>
<br>
* It is not async-exception safe and may leak file descriptors. It uses `handleToFd` without proper exception handling (`bracket`).<br>
* It does not `fsync` the directory in which the file is, meaning that you may still experience data loss on computer crashes.<br>
<br>
`unliftio` provides actively maintained versions of most of what `cautious-file` does, addresses those drawbacks and is well-tested against crashes:<br>
<br>
<a href="https://hackage.haskell.org/package/unliftio-0.2.12/docs/UnliftIO-IO-File.html" rel="noreferrer" target="_blank">https://hackage.haskell.org/package/unliftio-0.2.12/docs/UnliftIO-IO-File.html</a><br>
<br>
For example, `writeBinaryFileDurableAtomic`.<br>
<br>
Niklas<br>
</blockquote></div>