Subdomain Posts
PHP | 3 days ago
PHP | 160 days ago
PHP | 162 days ago
PHP | 197 days ago
PHP | 209 days ago
PHP | 250 days ago
PHP | 432 days ago
PHP | 478 days ago
PHP | 568 days ago
PHP | 568 days ago
Recent Posts
None | 10 sec ago
None | 12 sec ago
None | 19 sec ago
None | 21 sec ago
None | 24 sec ago
None | 26 sec ago
C++ | 34 sec ago
None | 1 min ago
C | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Sam Yong on the 30th of Aug 2008 01:44:53 PM
Download |
Raw |
Embed |
Report
/************************************
Recursive directory size calculation function
http://thephpcode.blogspot.com/
Author: Sam Yong
blog: http://thephpdeveloper.blogspot.com/
No illegal use of this script is allowed.
************************************/
function dirsize($dirname) {
// check whether the directory is valid.
return false;
}
$dirname_stack[] = $dirname;
$size = 0;
do {
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..' && is_readable($dirname . DIRECTORY_SEPARATOR . $file)) {
if (is_dir($dirname . DIRECTORY_SEPARATOR . $file)) {
$dirname_stack[] = $dirname . DIRECTORY_SEPARATOR . $file;
}
$size += filesize($dirname . DIRECTORY_SEPARATOR . $file);
}
}
} while (count($dirname_stack) > 0
);
return $size;
}
Submit a correction or amendment below.
Make A New Post