Sorry, I didn't word that to well. On my website people can write messages to a text file. Sometimes though I can get quite a few poeple on the site and I want to ensure that you don't get one person writting to the file at the same time as someone else. I figured I could do this by testing to see if the file is already open, by another user, if it is then I can pause the script (using sleep()) and then try again. As far as I can see the script you posted will only tell you if the file is open in the current instance of the script, if that makes sence.
Is there a better way of doing this?