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

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

end.
