Did somebody change the automatic stdout.flush behavior?

Ali Çehreli acehreli at yahoo.com
Thu Feb 17 00:21:14 UTC 2022


On 2/16/22 4:17 PM, Adam Ruppe wrote:
> On Thursday, 17 February 2022 at 00:13:24 UTC, Ali Çehreli wrote:
>> In the past, the following program would throw a ConvException *after* 
>> sending the second message to stdout. Now the second message is not 
>> displayed at all. Wait! I just checked: The output is actually flushed 
>> but after the exception output.
> 
> the default is to flush on the newline.... (unless it is a pipe, which 
> happens with a lot of IDEs, in which case it flushes on a buffer size 
> threshold).
> 
> since you have no newline here im pretty sure this is the same as how it 
> always worked..... i think.

I know but the other rule is that reading from stdin flushes stdout 
automatically. At least I've been assuming that there is such a link 
between those streams. :)

My current assumption is that somebody changed the order of stderr vs. 
stdout. That's why the output is more confusing to me now. Just a guess...

Ali





More information about the Digitalmars-d mailing list