[fpc-pascal] (Unix) file locking

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Mon Jun 20 11:28:46 CEST 2016


I'm approaching a situation where up to four identical processes will be 
reading and writing the same files. There will be process-level 
synchronisation which should prevent clashes, but I'd still like to add 
locking at the file level.

I presume that what I should be looking at is Fcntl(F_SetLk) etc., but 
what is the appropriate API for reading and writing? All access will be 
in fixed-size (256 byte) blocks, and blocks will be aligned.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list