I am having a problem with one of my scripts. Currently I use fopen, fwrite, and fclose statements to write large amounts of data into one file on my server (MySQL is currently not an option). It works fine for a while, but then when I go back to check the data something happens and where in the information should be is either a or nothing at all.
This does not happen all through the file, but instead in just certain areas. I've tried everything I can think of to preserve the data file, but with the amount of people that use it (about a couple thousand a day who take the data, explode there personal data, implode the data, and then write it back to the file) it works for a while and then all of a such the data is gone.
To cut down on some interference I tried CHMODing the file to 777, 755, 606, and 6, but none of which seem to help.
Is there another statement I can use that won't cause this problem other than fwrite, or am I doomed to have to fix the data repeatedly? I have enough backups running through the data that I don't lose any, but it is a hassle to have to repair the file constantly.
Thank you for any help you can be.