Originally posted by ahundiak
Hmmm.
Now you have added a different dimension to the problem. What happens if user 2 tries to read the file at the exact same time that user 1 is writing it? You could get corrupted data. (Many caching systems suffer from this same defect).
Best to use a database in this particular instance.
That's a good point. Now, when I say User 1, and User 2, I literally mean there will only ever be 2 users accessing the file. I assume the time it would take to open the file, read/write one character, and close it again would be quite small. But I suppose there is a SLIGHT possibility it could be accessed simutaneously. Anyone's thoughts?
Is it worth switching to the DB option to avoid the possibility of 2 of 2 users accessing the file simutaneously for that one character? I don't know exactly what timeframe we're looking at here, I'm assuming it would be milliseconds, right?