PHP File Management

Programming, for all ages and all languages.
Post Reply
Guest

PHP File Management

Post 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.
Paeron

Re:PHP File Management

Post 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.
Post Reply