program FLockTest;
uses
  BaseUnix, Unix;
var
  InputFile: TextFile;
  S: String;
  
begin
  AssignFile (InputFile, 'Lock.txt');
  WriteLn ('Before Flock');
  Flush (Output);
  Fpflock (InputFile, LOCK_EX);
  WriteLn ('After Flock');
  Flush (Output);

  ReadLn (S);
  WriteLn (S);
  
  CloseFile (InputFile);
  WriteLn ('After CloseFile');

end.
