...

View Full Version : Directories



Flamerule
07-11-2002, 10:13 AM
Is their a special function to count how many space the files are taking up in a directory or must I use the readdir function with a few loops and add the space each file takes individually?

Jeewhizz
07-11-2002, 10:44 AM
www.php.net/disk-free-space

Try that :)

Jee

Flamerule
07-11-2002, 11:51 AM
I don't want the space available I want the space used....

Robbie
07-12-2002, 12:13 AM
uh...

total_space - free_space = space_that_is_used

or am I saying stupid things now?

IKinsler
07-12-2002, 07:27 PM
If you did use a readdir, you could count each one...

while ($file = readdir($dir_var)) {
$filesize = $filesize + filesize($file);
}

echo "The total space used is: " . $filesize;

Flamerule
07-12-2002, 08:37 PM
Yea I know, just wondering if there was no specific function to do that. Thanks anyways :):D

Íkii
07-12-2002, 09:45 PM
disk_total_space(string dirname) -
http://www.php.net/manual/en/function.disk-total-space.php

should do it - I used it today on localhost and got absolutely no
return though and ergo went with the filesize(each file) method.

Flamerule
07-13-2002, 08:11 AM
Thank you :):thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum