<div><div dir="auto">At least naively, this seems like a really good idea.  </div></div><div dir="auto"><br></div><div dir="auto">1) do folks who have more experience across the range of supported platforms have any opinions about these additional semantics ?</div><div dir="auto"><br></div><div dir="auto">2) are these names suitably descriptive / unambiguous and or otherwise widely used / discoverable ? </div><div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 30, 2020 at 12:22 PM Grey Mitchell <<a href="mailto:grey@quietmisdreavus.net" target="_blank">grey@quietmisdreavus.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The current behavior for System.IO.openFile will either truncate an existing<br>
file (with WriteMode) or append new content to the end (with AppendMode).<br>
However, there's another behavior that's available from the underlying API:<br>
signal an error when the file already exists. I poked around at the code and i<br>
think that with a couple extra variants of IOMode, this behavior could be added<br>
with a relatively small patch.<br>
<br>
I have a branch pushed where i added this behavior:<br>
<a href="https://gitlab.haskell.org/QuietMisdreavus/ghc/-/commit/1ff18d4d3fc63f42c371f4046ab07405299c6755" rel="noreferrer" target="_blank">https://gitlab.haskell.org/QuietMisdreavus/ghc/-/commit/1ff18d4d3fc63f42c371f4046ab07405299c6755</a><br>
<br>
I'm a relative newcomer to contributing to GHC or the base library, so if i'm<br>
missing something in my patch please let me know. Specifically, i would like to<br>
know is there's a place i can add a test for this behavior. I'm also open to<br>
changing the names of the new IOModes - this was just something i wrote in to<br>
get something working.<br>
<br>
Looking forward to working with maintainers to get this added!<br>
<br>
Thanks,<br>
Grey Mitchell (@QuietMisdreavus)<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div>
</div>