Re: DirectoryIterator
| From: | Paul M Foster | Date: | Tue, 26 Jan 2010 21:37:22 +0000 |
| Subject: | Re: DirectoryIterator | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301497@lists.php.net to get a copy of this message | ||
On Tue, Jan 26, 2010 at 10:01:12PM +0100, Kim Madsen wrote:
> 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.
This assumes the "du" command is available on the host system. Check
first to make sure.
Paul
--
Paul M. Foster