You are here: Reading directory contents « PHP « IT news, forums, messages
Reading directory contents

Posted by Ashley M. Kirchner on 03/12/05 09:32

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация