<div><div dir="auto">Hi Per,</div><div dir="auto"><br></div><div dir="auto">Hmmm ... So If i understand it well, we've no control on that after all.</div><div dir="auto"> </div><div dir="auto">The data can still be buffered on the kernel side. </div><div dir="auto"><br></div><div dir="auto">Thanks </div><div dir="auto">/Frank</div><br><div class="gmail_quote"><div>Le ven. 1 sept. 2017 à 14:58, Per Hedeland <<a href="mailto:per@hedeland.org">per@hedeland.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2017-09-01 13:58, Frank Muller wrote:<br>
> Can someone help on this please?<br>
<br>
Well, what is the problem that you want to solve? Erlang doesn't really<br>
have an equivalent to C stdio, and anything you write with io:format/1,2,3<br>
to "standard output" is sent immediately to the OS via a write(2) (or<br>
typically writev(2)) call. Are you seeing something else? Try this:<br>
<br>
erl -noshell -eval 'io:format("foo "),timer:sleep(2000),io:format("bar~n"),timer:sleep(2000),erlang:halt(0)'<br>
<br>
--Per<br>
<br>
> Thanks<br>
> /Frank<br>
><br>
> Le mer. 30 août 2017 at 07:21, Frank Muller <<a href="mailto:frank.muller.erl@gmail.com" target="_blank">frank.muller.erl@gmail.com</a> <mailto:<a href="mailto:frank.muller.erl@gmail.com" target="_blank">frank.muller.erl@gmail.com</a>>> wrote :<br>
><br>
> Hi Prakash,<br>
><br>
> Thanks, but I doubt it's that easy.<br>
><br>
> In C, you've to call fflush or set the stdout to unbuffer mode.<br>
><br>
> /Frank<br>
><br>
> Le mer. 30 août 2017 à 06:51, Prakash Parmar <<a href="mailto:prakashkumar_parmar@thbs.com" target="_blank">prakashkumar_parmar@thbs.com</a> <mailto:<a href="mailto:prakashkumar_parmar@thbs.com" target="_blank">prakashkumar_parmar@thbs.com</a>>> wrote :<br>
><br>
> Hi Frank,<br>
><br>
> As per my experience, Like in C, keeping newline "~n" in io:format will flush it to screen.<br>
><br>
> /Prakash<br>
><br>
> -----Original Message-----<br>
> From: "Frank Muller" <<a href="mailto:frank.muller.erl@gmail.com" target="_blank">frank.muller.erl@gmail.com</a> <mailto:<a href="mailto:frank.muller.erl@gmail.com" target="_blank">frank.muller.erl@gmail.com</a>>><br>
> Sent: Wednesday, August 30, 2017 9:58am<br>
> To: "Erlang-Questions Questions" <<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a> <mailto:<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>>><br>
> Subject: [erlang-questions] Flush "stdout" buffer<br>
><br>
> Hi guys,<br>
> I'd like to know if there's an equivalent function to C fflush(stdout) ?<br>
> I've a small Erlang program which prints data to stdout. After every io:format call, I'd like to ensure output is flushed to screen.<br>
> Thanks in adavance.<br>
> /Frank<br>
><br>
><br>
><br>
> ******* DISCLAIMER: This email and any files transmitted with it are privileged and confidential information and intended solely for the use of the individual or entity to which they are<br>
> addressed. If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its<br>
> contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Torry Harris Business Solutions has taken every reasonable precaution to minimize this risk,<br>
> but is not liable for any damage you may sustain as a result of any virus in this e-mail. The recipient should check this email and any attachments for the presence of viruses. THBS reserves<br>
> the right to monitor and review the content of all messages sent to or from this e-mail address********<br>
><br>
> ******* DISCLAIMER: This email and any files transmitted with it are privileged and confidential information and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Torry Harris Business Solutions has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. The recipient should check this email and any attachments for the presence of viruses. THBS reserves the right to monitor and review the content of all messages sent to or from this e-mail address.********<br>
><br>
><br>
><br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
<br>
</blockquote></div></div>