>I have never tried this but you might try renaming the file instead of fopen(). You could wrap this in a try catch loop and if you get an error assume that it is in use. If rename is successful, then you know it was not in use and another user can't access the file.
Well, in this case, we might as well just use TRY CATCH with what we have now. But, I was looking for a way to avoid going into that. I have never used such an approach. I try to always do code that will work.