note 41125 deleted from function.readdir by tomsommer
| From: | tomsommer@php.net | Date: | Sun, 27 Jun 2004 13:11:53 +0000 |
| Subject: | note 41125 deleted from function.readdir by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71879@lists.php.net to get a copy of this message | ||
Note Submitter: wouter-php@fort-knox.rave.org
----
gehring[at-no-2-spam]egotec.com: nice example. I'm sure it's just a typo, but just a note
for confused new users though: Change
if($file !== "." or $file !== "..") {
to:
if($file !== "." and $file !== "..") {
... otherwise you'll end up with an infinite loop.
(! (x or y)) -or- (!x and !y).
And throw out the "$append" line, AFAIK.
I don't know what this will do to recursing symlinks and other fun stuff, though, so anybody
reading this and wanting to do something similar, might want to consider a max_recursions parameter.