It's a good idea to lock the file using lock shared or LOCK_SH when reading a file, that way no one can manipulate it while someone reads it (i.e. delete or write to it) but others can read it as well. You may want to check out turnstep's Tutorial on File Locking.