How can I check if a file has been locked by another process in my script? Because its a cgi script and can be used my multiple users, hence causing a problem with the file it writed to. Im not very familiar with file locking so any help would be appreciated.
Just after I open the file in question I use
flock(FILE, LOCK_EX);
and after I close it I use
flock(FILE, LOCK_UN);
But using the above still causes problems with the data file.
Thanks