note 8003 added to readdir
| From: | deirdre at deirdre dot net | Date: | Wed, 23 Aug 2000 20:47:14 +0000 |
| Subject: | note 8003 added to readdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3040@lists.php.net to get a copy of this message | ||
There is a bug in the code I posted above that prevented something I was doing from working.
Specifically, after you return from recursing a directory, you need to re-set the directory to its
parent. Otherwise, you won't be able to open a file and do anything with it.
The KISS way of doing it is:
after the closedir($closedir); add:
chdir("..");
http://www.php.net/manual/function.readdir.php