Hi.
If I use Flock to lock a file once open, when other people run the script (visit webpage), will they queue in turn to access the file, eventually being able to access it? Is there a time out?
I have been using an IF argument, so if no lock is made, the script continues. Looking at my code, this is undesirable. I would prefer the script to wait until the script can use the file.
There are times when several people may be trying to access the same file - The script should run and complete in seconds.
Thanks.
Hi
I can't get flock() to work, it seems to be such a simple function but I am stumped.
What I think I know...
1. There is a blocking and advisory mode (blocking, waits for a lock whereas advisory lets you know if a lock was succesfully applied)
2. Some UNIX systems do not support blocking
3 Open the file with fopen (+r), apply flock() and if the lock is successful, write to the file.
I have my script