I want to know how you make a lock file with flock(), I have searched for help but couldn't find it.
Should I use the sleep() function when I add something to a file so that users can't hit the refresh button like 3 times in a second?
Isn't there a risk that the update will be interrupted and the file will be truncated?
I would be very grateful if someone could help me with this, thanks! 🙂