I am creating a flatfile database, and I am trying to solve the problem of multiple edits being made at the same time. I understand I need to truncate the file for editing and deleting rows but for adding rows this is not necessary.
So if I were to use fopen($file, 'a') to write to a file, and multiple people where to open the file and write to it, would they all be able to write to the file simultaneously?
Without truncating the file people shouldn’t be overwriting each other right?
It’s better to use some kind of helper for this.
PHP function flock (File LOCK)
PHP file write threading issues
Read and write to a file while keeping lock