/*
 *@dirPath  被查询目录的全路径
 *@storage 保存文件所占磁盘大小的变量
 *
 * eg:$storage = dirStorage('/var/www/user');//查看/var/www/user 文件夹所占的大小
 */
function dirStorage( $dirPath , $storage=0){
        $dir = opendir($dirPath);
        while( false !== ( $file = readdir($dir) ) ){
                if( substr($file, 0, 1) === '.') continue;
                if( filetype($dirPath.DS.$file) == 'dir' ){
                        return $this->dirStorage($dirPath.DS.$file, $storage);
                }else{
                $storage += intval( filesize($dirPath.DS.$file) );
        }
        }
        closedir($dir);
        return $storage;
}
											日历
2025年十一月 一 二 三 四 五 六 日 « 9月 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 - 		
近期文章
 分类目录
friend
-