[Issue 13778] New: Flush stream when std.stdio.writeln() is called
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Nov 26 04:30:15 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13778
Issue ID: 13778
Summary: Flush stream when std.stdio.writeln() is called
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: bruno.do.medeiros+deebugz at gmail.com
This is an enhancement request to flush the stdio stream whenever
std.stdio.writeln is called (but not for std.stdio.write).
The problem this is causing, is for example that when running D programs under
Eclipse (which creates its own console), no flushing is done when a newline is
received. According to this SO question:
http://stackoverflow.com/questions/19498040/eclipse-console-writes-output-only-after-the-program-has-finished
, Adam D Ruppe has commented the following:
"I'm not entirely sure what's going on here, but I think the line buffering
only happens if the receiving end is a regular terminal. Otherwise, it gets the
same buffering as any other file (because it likely is any other file). With
Eclipse, again I'm guessing, it is probably talking to the eclipse process
through a pipe, and that isn't registering as an interactive terminal so it
goes back to full buffering."
As a note of interest, Java's `System.out.println()` has the behavior requested
here, it does flushing automatically at the end of the call.
--
More information about the Digitalmars-d-bugs
mailing list