On 11 Jan 2003 at 15:40, J. David Bryan wrote:
On 10 Jan 2003 at 9:58, Frank Heckenbach wrote:
Can you add `WriteLn (FileHandle (f^))' there to see what happens?
Given:
repeat New (f); Reset (f^, ParamStr (1)); WriteLn (FileHandle (f^)) until FileHandle (f^) >= 8;
...the program outputs "0" forever.
Ignore the above. This is "pilot error" on my part on re-running the test to determine why it failed. I ran the test file directly, rather than via the test suite makefile with MASK="fjf663.pas". As a result, it did not receive the first commandline parameter (i.e., ParamStr (1)), and so the program looped indefinitely.
The correct problem description is as follows. Given this instrumented version of the test program:
program fjf663;
uses GPC;
var f: ^Text; s: array [1 .. 1] of PAnyFile;
begin writeln; writeln (ParamStr (1)); repeat New (f); Reset (f^, ParamStr (1)); writeln (FileHandle (f^)) until FileHandle (f^) >= 8; s[1] := f; writeln (IOSelectRead (s, 0)); if IOSelectRead (s, 0) = 1 then WriteLn ('OK') else WriteLn ('failed') end.
...I obtain these results:
GPC-TEST-BEGIN ========================== TEST fjf663.pas: ./fjf663.pas 3 4 5 6 7 8 -1 failed ========================== GPC-TEST-END
My apologies for the original, incorrect report.
-- Dave