Re: DirectoryIterator
| From: | Kim Madsen | Date: | Tue, 26 Jan 2010 21:01:12 +0000 |
| Subject: | Re: DirectoryIterator | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301492@lists.php.net to get a copy of this message | ||
Christoph Boget wrote on 26/01/2010 21:17:
I've looked through the docs but was unable to find out if this is possible; I hope it is. Is there a way that you get the size/length of the collection to be iterated (e.g. the total number of files) without having to iterate through at least once?On Linux with safe mode off you can call system("du -hcs THE_DIR") to get the size of all files, no iterations needed. Number of files could be a find command piped into wc -l, called from system(), like find . -name "*" | wc -l (but that would count dirs aswell) -- Kind regards Kim Emax - masterminds.dk