But it's even more important to remember that what you've just sketched out is not multiprocess safe! Absolutely nothing but statistical probability and/or dumb luck (your choice) prevents
if(file_exists('saved.txt')){
from being reached by 2 (or, to be perfectly honest, <i>n</i>) processes at the same time. Guess what happens next? :-(