[fpc-devel] Output flush on pipes
Michael Van Canneyt
michael at freepascal.org
Sun May 14 11:12:10 CEST 2006
On Sun, 14 May 2006, Martin Schreiber wrote:
> On Sunday 14 May 2006 08.48, Daniƫl Mantione wrote:
> > Op Sun, 14 May 2006, schreef Martin Schreiber:
> > > Since some time FPC doesn't flush output on pipes after writeln.
> > > On linux I can use a pseudo terminal, what can I do on win32 to get
> > > flushed output from FPC into the message window of MSEide?
> >
> > It is strongly recommended against to parse the compiler output, as it is
> > designed for humans, not computers. The formatting of the compiler output
> > can therefore change in time and can also be configured by the user in any
> > language. Some people are doing it anyway, like Lazarus.
> >
>
> I do not parse the output of FPC, I display it in a message window for humans.
> It is possible to continue working with MSEide while compiling (very useful
> because I must use -B the most of time with 2.0.3 because of compiler crashes
> and memory overloads). But I wish to see what's going on compiling in
> realtime.
>
> Same problem with FPC console programs on win32, the MSEide target window uses
> a pseudo terminal on Linux -> output is flushed, on win32 I can only use
> pipes -> program output is only visible if output buffer overflows or on
> program termination.
>
> Suggestion:
> On win32 switch automatic output writeln flush only off by regular files
> (FILE_TYPE_DISK) but not by pipes (FILE_TYPE_PIPE):
>
> rtl/win32/sysfile.inc
>
> function do_isdevice(handle:thandle):boolean;
> begin
> do_isdevice:=(getfiletype(handle)=2);
> end;
>
> change to:
>
> function do_isdevice(handle:thandle):boolean;
> var
> wo1: dword;
> begin
> wo1:= getfiletype(handle);
> do_isdevice:= (wo1 = FILE_TYPE_CHAR) or (wo1 = FILE_TYPE_PIPE);
> end;
I would at least make it
do_isdevice:=(getfiletype(handle)<>FILE_TYPE_DISK);
so it includes 'unknown' file types and future file types.
Michael.
More information about the fpc-devel
mailing list