I'm using a simple text file as a hit counter, and trying to get a reliable way of updating it, using flock() to prevent more than one client updating the file at the same time, because that can cause the counter to reset to zero.
What is the way to do this? Do I need a separate lock file, maybe?
And ... has anyone managed to get flock() to work on a Windows system? The manual says that it should work, but it doesnt seem to. It makes locking impossible to test on my PC before uploading to my webspace.