[fpc-devel] FpFlock with Text as argument

amir amir at aavani.net
Thu May 8 03:58:16 CEST 2008


Hi,

I don't know if it is a bug or I am using fpflock incorrectly. I wanted 
to use fpflock to lock a file (and be sure that only one process at a 
time can have access to my file).

At first, I tried AssignFile and passed the TextFile(Text) variable to 
fpflock with LOCK_EX. It didn't work and both processes can access the file.
Both print "After Flock".

Then I modify the code, and used fpopen instead of AssignFile and passed 
the cInt variable to fpflock . This worked.

I attached the codes of both experiments.

Amir


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: UsingAssignFile.pp
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20080507/d4424e95/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: UsingFpOpen.pp
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20080507/d4424e95/attachment-0001.ksh>


More information about the fpc-devel mailing list