View Single Post
  #1 (permalink)  
Old May 17th, 2007, 05:14 PM
jmjlm jmjlm is offline
Registered User
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simultaneous file write

I have a small website where members enter information and it is saved. The number of users isn't large (typically <50), so I use a simple text file to store the data. Users can modify their information, so I have the "open file, read all data, close file, modify data, create file, write file" logic. Everything works fine, or so I think.

Since multiple users can access the site "simultaneously", does the CreateTextFile method or Write method serialize requests? Or if UserA and UserB click "Save" at the same time, will one of the saves be lost? I can't find in any text the answer to this question.

I could use a database to solve this, but it seemed to be a bit of overkill. However, if that is the only way to solve this, that's what I'll implement next.

Thanks for any help/suggestions!

Jeff


Reply With Quote