Link to home
Start Free TrialLog in
Avatar of rainette
rainette

asked on

file locking in GNU pascal for Linux

I have a pascal program that has to be launched by a PHP script on server in Linux environment. This program reads/writes a lot of files. How could I lock a read or written file to properly manage multiple users access ? In C language this is a 'flock' function, but I could not find a similar function in Pascal. I use GNU pascal compiler gpc for linux.
Thank you in advance for a response.
Avatar of Jeff_2
Jeff_2

FreePascal has an flock function in the 'linux' unit.

I have also found that it generates much smaller and faster applications than GPC.

The rest of your code should be be portable with a few minor 'tweaks'.

http://www.freepascal.org
ASKER CERTIFIED SOLUTION
Avatar of amp072397
amp072397

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
rainette:

Why did you accept my answer? I am not an expert and I did not provide you with any information about your question.

amp
community support moderator
Avatar of rainette

ASKER

Because I didn't know what to do