Page 1 of 1

open/read/write to FLAT file - question

Posted: Wed Sep 20, 2006 2:26 pm
by SomeOne
i use Flat file = pure txt file, to write some content in it...
everithing ok...though i have a question...
hipotetycli it's possible to hapen...
2 poeple 100% the same time push the "submit" button...
it is posible that the txt file gets empty....
can i prohibit this?
i have read about " Race condition (or race hazard)" and i alsow know i could solve this with "sem_acquire" but this funcion is not instaled on the server of my hosting provider...
so...
is there an alternative? mySQL or any other base is NOT an option!
HELP?! :?
p.s: sorry 4 bad english

Posted: Wed Sep 20, 2006 2:27 pm
by volka
2 poeple 100% the same time push the "submit" button...
it is posible that the txt file gets empty....
can i prohibit this?
yes and (probably) yes.
Take a look at http://de2.php.net/flock