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.
rainetteAsked:
Who is Participating?
 
amp072397Commented:
rainette:

Just a friendly reminder to return to your open questions.

thanks!
amp
community support moderator

2/8
0
 
Jeff_2Commented:
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
0
 
amp072397Commented:
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
0
 
rainetteAuthor Commented:
Because I didn't know what to do
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.