Reading directory contents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




A file system question for you folks.

We have a folder that contains the following structure of files for each of our sales reps in the company:

   $TOP_FOLDER$/
               /$SalesRep1/
                          /$Client1/
                                   /File1.ext
                          /$Client2/
                                   /File1.ext
                                   /File2.ext
               /$SalesRep2/
                          /$Client1/
                                   /File1.ext
                          /$Client2/
                                   /File1.ext
                                   /File2.ext
                          /$Client3/
                                   /File1.ext
                                   /File2.ext
                                   /File3.ext
   etc., etc.

What I'd like to do it iterate through this $TOP_FOLDER$ and generate a page that looks as follows:

   $SalesRep1   Clients: 2      Files: 3      Total size: xxx [MB/GB]
   $SalesRep2   Clients: 3      Files: 6      Total size: xxx [MB/GB]
   etc., etc.

So I need to traverse through all the directories, while counting stuff at the same time (ignoring . and .. as I go) and at the end do some pretty display of all the information (I can figure that out later, I just need to collect data right now.)

Right now, when I do an opendir() and readdir() I only get the contents of the top folder. How do I get the rest, and count the data as well?

   -- A

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux