Page 1 of 1

PHP File Management

Posted: Fri Jun 27, 2003 6:24 am
by Guest
Hi,

I am creating a web module in PHP that needs to access a file mostly for reading but there will be times when I need to write to it. The question is how can I safely access the file without two seperate threads accessing the file at the same time for writing, I know I can use flock() but I have been reading that this is not completely reliable. Does anyone know a reliable way to syncronise write access to a file between threads.

thanks.

Re:PHP File Management

Posted: Sat Jul 12, 2003 9:12 am
by Paeron
Firstly the chance that two threads will use the same file at the same time is close to none since it goes so fast.
And secondly use a database system like MySQL.