Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Simon Newsgroups: comp.lang.php Subject: Prevent unlink(...) warning Date: Thu, 17 Nov 2011 17:04:13 +0200 Lines: 35 Message-ID: <9ikm3eFih4U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net ekuV0K85kqHUgbCCI+weqgDe9fAY7czB1piNtc3EnaPF4gyz91 Cancel-Lock: sha1:asEIL/GfFxcafwSBhV5VQDsUAms= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:3817 Hi, I am having some race condition issues on my server when trying to delete a file. // function my_unlink( $filename ) { // remove the old file clearstatcache(TRUE, $filename); if (file_exists($filename)) { @unlink($filename); } else { return true; } clearstatcache(TRUE, $filename); return (!file_exists($filename)); // check it was deleted. } // In some cases I get unlink(/home/xxx/public_html/temp/yyy.zz) [function.unlink]: No such file or directory How can I prevent the warning? Thanks Simon