program Fjf659o;

var
  a: Text;

begin
  Rewrite (a);
  WriteLn (a, 'foo');
  Finalize (a);
  {$local I-} WriteLn (a, 'bar'); {$endlocal}
  if IOResult <> 0 then WriteLn ('OK') else WriteLn ('failed')
end.
