note 97514 added to function.copy

From: Date: Fri, 23 Apr 2010 13:59:51 +0000
Subject: note 97514 added to function.copy
Groups: php.notes 
Request: Send a blank email to php-notes+get-168562@lists.php.net to get a copy of this message
There is mistake in the function smartCopy() here beneath, in the use of the function 'readdir'. From the readdir() manual page : <?php /* This is the correct way to loop over the directory. */ while (false !== ($file = readdir($handle))) { echo "$file\n"; } /* This is the WRONG way to loop over the directory. */ while ($file = readdir($handle)) { echo "$file\n"; ?> I happened to have a file named '0' in one my folders, and, of course it didn't work properly ... Cheers. ---- Server IP: 195.221.21.36 Probable Submitter: 193.252.36.3 ---- Manual Page -- http://www.php.net/manual/en/function.copy.php Edit -- https://master.php.net/note/edit/97514 Del: integrated -- https://master.php.net/note/delete/97514/integrated Del: useless -- https://master.php.net/note/delete/97514/useless Del: bad code -- https://master.php.net/note/delete/97514/bad+code Del: spam -- https://master.php.net/note/delete/97514/spam Del: non-english -- https://master.php.net/note/delete/97514/non-english Del: in docs -- https://master.php.net/note/delete/97514/in+docs Del: other reasons-- https://master.php.net/note/delete/97514 Reject -- https://master.php.net/note/reject/97514 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#168562) next »