[fpc-pascal] file locking cross platform

no reply noreply at z505.com
Fri Apr 3 20:26:34 CEST 2015


I wrote:
> There are some major differences between the way Windows and Unix allow
> locking of files with their api's, but is it possible to make a cross
> platform LockFile() procedure or function for both unix and windows?


There is of course fpFlock for unix,

http://www.freepascal.org/docs-html/rtl/unix/fpflock.html

However this means implementing file locking differently on unix and
windows computers, which makes the application not cross platform.

I was hoping for something like LockFile and UnlockFile for both windows
and unix, instead of implementing locking using IFDEF WINDOWS and IFDEF
UNIX.

Lars


More information about the fpc-pascal mailing list