Do race conditions usually exist when writing OR appending to an existing file?
$f1 = fopen($filename1, 'r+');
$f2 = fopen($filename2, 'a');
What would happen if this code ran at the exact same time? Is there a chance that the data could be corrupted in the aforementioned code example?
Unfortunately flock is not thread-safe, this means that if this code runs in the EXACT same time (which is very very unlikely), then you will probably get file corruptions.