(*
The following works as a program, but not as a unit (used e.g. by an empty
program). It gives the following runtime message (DJGPP and Linux):

?GPC runtime error: (gpc-rts) _p_initfdr() has not been called for file (#701)
*)

unit fooprint;

interface

var Lst:Text;

implementation
to begin do
begin
  Assign(Lst,'foo.dat');
  Rewrite(Lst);
  writeln(Lst,'OK');
  Close(Lst)
end;
end.

program fjf17;

uses fooprint;

var
  a:text;
  b:string(10);

begin
  reset (a,'foo.dat');
  readln (a,b);
  writeln (b)
end.
