[fpc-devel] Output flush on pipes

Florian Klaempfl florian at freepascal.org
Sun May 14 20:17:52 CEST 2006


Martin Schreiber wrote:
> On Sunday 14 May 2006 17.16, Florian Klaempfl wrote:
>>> I need no machine readable output (up to now), I need a way to get
>>> flushed writeln output from the RTL on widows to display it in the MSEide
>>> message window (compiler output) and the target window (program output).
>>> On linux I use a PTY to connect compiler and target -> all is OK, on
>>> win32 I can only use pipes AFAIK where the RTL doesn't flush output on
>>> writeln.
>> I don't think that it is wise to flush always when writing to pipes only
>> for the compiler. -vm could for now force an additional flush.
> 
> The problem exists not only for the compiler but for all console programs.
> I found no way to display the interactive output in a IDE window on win32.
> On Linux I can use a pseudo terminal to get flushed output from target.
> There are no pseudo terminals on win32, I must use pipes. The current 2.0.3 
> RTL does not flush output on writeln if the filehandle is a pipe (2.0.2 
> does!). So the IDE target console window is unusable on win32 with FPC 2.0.3 
> RTL and works OK with FPC 2.0.2 RTL.

Yes and no :) That's one of speed vs. usability decisions. Believe me,
if flush pipes always, people will complain soon that FPC is too slow
when writing to pipes.



More information about the fpc-devel mailing list