|
Posted by julian_m on 04/18/06 05:24
I'm just beggining to write some simple-small script which is gonna
work as a mini chat.
First aproach:
File: comments.xml
every time this file is accessed, I delete the first line (if number of
lines is > than x) and add one to the end :
<com>hello</com>
<com>hello, how are you</com>
<com>fine, thanks</com>
In client side, I just load this xml inside a div every "n" seconds,
using ajax
I'm wondering what's going to happen if two or more users try to acces
to the file at the same time, beacause I don't want to lock the file at
all...
Is it to use a database a better option? I choice the file option
beacause I thought that speed would be better.
What would you do?
Navigation:
[Reply to this message]
|