Calculate Directory Size
| From: | Simon H | Date: | Sat, 26 Jan 2002 14:40:06 +0000 |
| Subject: | Calculate Directory Size | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-736@lists.php.net to get a copy of this message | ||
I'm not sure if this is the right place for this query or not, but it does
involve a bit of Pear DB and DB Pager.
Here's my problem...hopefully someone can help, because I've no idea where
to even start!
I have a user database, with a table called Users, and fields as so:
(it would be cool if this would work on both Linux and Windows)
-------------------------------------------------------------
User DiskUsage (Mb) Quota (Mb) HomeDirectory
-------------------------------------------------------------
jim 50 100 F:\users\jim \\ In Windows
jim 50 100 /users/jim \\ In Linux
-------------------------------------------------------------
The database wouldn't be shared between Windows and Linux, just 1 or the
other.
What I would like to be able to do is, press a button on a php page, and
scan the (MySQL or ODBC through Pear DB) database, and for each user,
calculate the size of their HomeDirectory, and Update the DiskUsage in the
DB accordingly.
I'm wondering tho how this would work with say 1000's of users each with
several hundred Mb's or even several Gb's each. The users will have
subfolders too, so the function would have to recurse the dirs.
Is this even possible with PHP?
I appreciate any help I can get on this, because its waaaaaay beyond me
presently.
Thanks
Simon H