I have this code in my application, often run in race condition by severals users of my application
clearstatcache(TRUE, $filepath);
if(file_exists($filepath)) unlink($filepath);
But, for this line of code, I still have severals errors each day like
unlink(file): No such file or directory
Server run Apache 2.2 and PHP 5.3.3. I know race problem, but think @ operator is just evil. I have first tried without any parameter for clearstatcache(), with the same error. How can I do it the correct way?