<div dir="ltr"><div>On Sun, Aug 3, 2014 at 3:08 PM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div dir="ltr"><div class="gmail_extra"><div><div><div class="gmail_quote">On Sun, Aug 3, 2014 at 2:43 PM, Elliot Robinson <span dir="ltr"><<a href="mailto:elliot.robinson@argiopetech.com" target="_blank">elliot.robinson@argiopetech.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">On Sat, Aug 2, 2014 at 3:54 AM, Donn Cave <span dir="ltr"><<a href="mailto:donn@avvanta.com" target="_blank">donn@avvanta.com</a>></span> wrote:<div>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Handles are for buffered I/O.</blockquote><div> </div></div>


<div>If this is the case, why is NoBuffering provided? Why does the documentation for Handle explicitly mention non-existent and zero-length buffers? If Handles are the standard cross-platform interface to buffered file IO, what is the standard cross-platform interface to unbuffered IO (output, specifically, since input is technically always at least 1 byte buffered)?</div>


</div></div></blockquote></div><div class="gmail_extra"><br></div></div></div>Handles provide a non-buffered interface, but often if you truly need unbuffered I/O you will be better suited by the platform's primitive operations; for which abstractions that enable some kind of reasonably platform independent interface may well cancel out the advantages of unbuffered I/O for those cases.</div>


</div></blockquote></div><div><br></div><div class="gmail_extra">As a platform-specific optimization, this makes total sense. Most of the people who need this optimization know they need it. My fear is that offering "handles are for buffered I/O" (and statements like it) as general case rules leads to the "I'm new to <field> and I'm using <a href="http://System.Posix.IO">System.Posix.IO</a> for unbuffered IO because Handles aren't good for that, and now my program doesn't compile on <non-Posix OS>" ilk of Haskell-Cafe/SO questions.</div>


<div class="gmail_extra"><br clear="all"><div><div dir="ltr">---<div>Elliot Robinson</div></div></div></div></div>