note 22691 deleted from function.unlink by dams

From: Date: Fri, 28 Jun 2002 01:40:53 +0000
Subject: note 22691 deleted from function.unlink by dams
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-32331@lists.php.net to get a copy of this message
Don't know is this a bug or a feature of PHP. When I let the following code runs for like 20 seconds and close browser. Then run another PHP code that writes content to file $page. I either sees no error and that the file $page does exist in the system. Or I see the file $page exist for about 1 second and disappear. But after creating x time of file $page, file $page then will not be deleted. I wonder can it be that PHP is still running the code below which unlink the file or the unlink commands are cached and execute. while(1){ $contents=""; $fp=@fopen("$page", "r"); if($fp){ while(!feof($fp)){ $contents.=@trim(fgets($fp, 128)); } fclose($fp); } if($contents!=""){ @unlink("$page"); } sleep(2); }

« previous php.notes (#32331) next »