www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How do I flush the output of write?

reply Andrej Mitrovic <none none.none> writes:
Calling write doesn't automatically flush the output to the screen. Is there a
function I could call to do it manually? writeln doesn't suffer from this
problem.
Apr 13 2011
parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Wed, 13 Apr 2011 14:00:04 -0400, Andrej Mitrovic <none none.none> wrote:

 Calling write doesn't automatically flush the output to the screen. Is  
 there a function I could call to do it manually? writeln doesn't suffer  
 from this problem.
stdout.flush(); -Steve
Apr 13 2011
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I kept trying to do flush(stdout), but I had the syntax wrong I guess. :)

Thx.
Apr 13 2011
parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Wed, 13 Apr 2011 15:41:07 -0400, Andrej Mitrovic  
<andrej.mitrovich gmail.com> wrote:

 I kept trying to do flush(stdout), but I had the syntax wrong I guess. :)
fflush(stdout) is the way to do it in C, so that's probably where you got it from. in D, stdout is actually a File struct, which contains a flush method. -Steve
Apr 13 2011