On Fri, Jun 24, 2011 at 3:03 PM, Kagamin <span dir="ltr"><spam@here.lot></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">Jimmy Cao Wrote:<br>
<br>
> No, it writes to stdout which (in this case) is line-buffered.  Whenever<br>
> there's a newline character, it is supposed to flush.<br>
<br>
</div>There're no characters in binary data. This is low-level API. If you want the library to care about characters and do various things, maybe you need a high-level text API like printf or even better phobos std.stdio.write?<br>


</blockquote></div><br><div>Actually, low-level is like using cputs from conio.h.</div><div><a href="http://www.digitalmars.com/rtl/conio.html">http://www.digitalmars.com/rtl/conio.html</a> </div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">

<font class="Apple-style-span" size="1">"<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; line-height: 22px; background-color: rgb(255, 255, 255); ">They bypass the stdin and stdout buffers and access the console directly."</span></font></blockquote>

<div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; line-height: 22px; background-color: rgb(255, 255, 255); font-size: medium; "><br></span></div><div><font class="Apple-style-span" face="Arial, Helvetica, sans-serif" size="3"><span class="Apple-style-span" style="line-height: 22px;">Anyways, I was using to write an array of characters to stdout.  Since stdout was buffered, when the newline character was encountered, flushing should have occured.</span></font></div>

<div><font class="Apple-style-span" face="Arial, Helvetica, sans-serif" size="3"><span class="Apple-style-span" style="line-height: 22px;">Also, you do realize that std.stdio.write uses fwrite, right?  It's the same thing, except when writing wider chars or when fwide doesn't return 0, in that case something else is used.</span></font></div>

<div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; line-height: 22px; background-color: rgb(255, 255, 255); font-size: medium; "><br></span></div><div><br></div>