[fpc-pascal]CR / CRLF problem when redirecting to file

James Mills prologic at daisy.ods.org
Sun Sep 14 17:55:45 CEST 2003

On Sun, Sep 14, 2003 at 12:48:28PM -0300, John Coppens wrote:
> Hello all,
> In Linux, when redirecting FPC output to a file, I found that after 25
> lines, CR characters are being added, as if in DOS:
> program TestCR;
> uses
>   CRT;
> var
>   i: integer;
> begin
>   for i := 1 to 50 do
>     writeln('The quick brown fox jumps over the lazy dog''s back ', i);
> end.
> when doing a   ./testcr > testcr.txt
> CR's appear on line 25 and after. (This seems to profoundly confuse some
> terminal windows, which change mode and have to be 'reset').

Yes this happens all the time when dealing with stdin and stdout with
FPC. I'm not sure why either :) Log files can sometimes get really ugly
with CRLF's appearing where they shouldn't be (seeing as it's linux not

Perhaps it's a bug  ?


-Zero Defect Software Engineers Group - ZDSEG
-You need only two tools. WD-40 and duct tape.
-If it doesn't move and it should, use WD-40.
-If it moves and shouldn't, use the tape.

More information about the fpc-pascal mailing list