I have this code in my application, which is often run in race mode by individual users of my application.
clearstatcache(TRUE, $filepath);
if(file_exists($filepath)) unlink($filepath);
But for this line of code, I still have separate errors every day, like
unlink (file): No such file or directory
The server starts Apache 2.2 and PHP 5.3.3. I know the race issue, but I think the @ operator is just evil. I first tried without any parameters for clearstatcache () with the same error. How can I do it right?
source
share