{: test that accessing a file after eof causes a fatal error }

{$d+}
program d04b( output );

var
   f    : text;
   c    : char;

begin {d04b}

   rewrite(f);
   writeln(f, 'xyz');
   reset(f);
   readln(f,c); {should now be at eof}

   if f^ = ' ' then {!!! invalid file access}
      writeln('this should not be printed');

   writeln( 'fails: file buffer access f^ when at eof error not detected' );
end. { d04b }

