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

{$d+}
program d04d( output );

var
   f    : text;
   c    : char;

begin {d04d}

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

   read(f,c); {!!! invalid file access}

   writeln( 'fails: read when at eof error not detected' );
end. { d04d }

