[fpc-pascal]Reading from stdin-pipe (bug?).

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Sat May 17 11:57:18 CEST 2003


On Sat, 17 May 2003, Arne Hanssen wrote:

> Consider this code and tell me if this is a bug (under win32):
> --------------------------------------------------------------------
> Program RedirTest;
> var
>   textstr: string;
>   begin
>     while not eof( input ) do begin
>     readln( input, textstr );    // No, using 'read()' won't do! ;-)
>     writeln( 'Read: ', textstr );
>   end;
> end.
> --------------------------------------------------------------------
>
> When input is piped to this program under Win32 (Win2K) error 109 is
> given:
> --------------------------------------------------------------------
> [...]
> Free Pascal Compiler version 1.0.6 [2002/04/23] for i386
> Target OS: Win32 for i386
> [...]
> d:\>echo Testing | redirtest
> Read: Testing
> Runtime error 109 at 0x004010B0
>   0x004010B0
>   0x00401109
> --------------------------------------------------------------------

I think (but I'm not sure) that this is caused by a patch applied by Pierre
Muller some time ago to the Win32 version of handling standard input.

Michael.





More information about the fpc-pascal mailing list