There is not std.stdio.flush
Lars T. Kyllingstad
public at kyllingen.NOSPAMnet
Mon Jul 20 06:23:57 PDT 2009
Ary Borenszweig wrote:
> Lars T. Kyllingstad wrote:
>> Lars T. Kyllingstad wrote:
>>> Haruki Shigemori wrote:
>>>> Hi.
>>>>
>>>> The std.cstream.dout has a member function dout.flush.
>>>> But the std.stdio has not a function flush or a similar function.
>>>> Why? Don't you want to have it?
>>>> Give me the std.stdio.flush!
>>>
>>>
>>> All the write functions in std.stdio (write, writeln, writef,
>>> writefln) flush automatically, so there is no need for a separate
>>> flush function.
>>>
>>> -Lars
>>
>>
>> Sorry, my mistake. It seems only writef and writefln flush
>> automatically. :(
>
> I don't think so. If I run my code in the Eclipse console it doesn't
> flush automatically and I have to do fflush(stdout). I think it depends
> on the console implementation.
That's weird, and probably a bug somewhere. This is the definition of
File.writeln() from the latest Phobos:
void writeln(S...)(S args)
{
write(args, '\n');
.fflush(p.handle);
}
where p.handle is the FILE* pointer.
-Lars
More information about the Digitalmars-d-learn
mailing list