Basically this is an business which will show some updated share information.
ha ha - I knew it was a gambling site ! ;-)
You're question is a good one - If you adopt Sarahk's solution then it won't be an issue, but then how will you're clients decide which file to pull down - that could get complicated very quickly...
But then - is this stuff really going to be updating every 5 seconds? The reason I ask is I've never seen a webpage update every 5 seconds - you wouldn't ever see too much!
So, if it really is updating every five seconds, then maybe generate 12 files a minute (one every 5 seconds) and call them say 5.php, 10.php, 15.php etc etc then when a client requests it, order the files in the directory and they take the second most recent (by creation time) so they have effectivly a maximum of a ten second delay on the market - but I'm really wondering if new dtaa every 5 seconds isn't a bit of overkill - I mean a lot of market resources have a 5 to 20 minute delay - that would get much easier to handle.
Anyway, if you use a system something like the above, then filelocking won't be a problem as no client would be accessing the file you are writing to right now.
anyway, I'm babbling a bit here - sounds like an interesting project
hope some of the above bable was of use
/s