[fpc-pascal]How to Lock a file?
milimeter at 163.com
Thu Aug 22 11:38:07 CEST 2002
Hello, Every one
I opened a file with TFileStream, and I don't want any other program to access
this file. So I try to lock it with FLock function in unit Linux as
fs : TFileStream;
h : integer;
if LockF(h,LOCK_EX) then writeln('Lock OK!') else writeln('Lock Failed!');
readln; // ----> Now, I test if I can still open this file with other
But, Still, I can open the same file with other programs.
So, Can you tell me how to lock a file correctly with free pascal?
More information about the fpc-pascal