note 61477 added to function.filesize

From: Date: Sat, 04 Feb 2006 20:42:58 +0000
Subject: note 61477 added to function.filesize
Groups: php.notes 
Request: Send a blank email to php-notes+get-103005@lists.php.net to get a copy of this message
Simplified recursive size measurement. Will also take into account the size of the folders themselves. function get_size($path) { if(!is_dir($path)) return filesize($path); if ($handle = opendir($path)) { $size = 0; while (false !== ($file = readdir($handle))) { if($file!='.' && $file!='..'){ $size += filesize($path.'/'.$file); $size += get_size($path.'/'.$file); } } closedir($handle); return $size; } } ---- Server IP: 216.194.113.175 Probable Submitter: 67.81.111.63 ---- Manual Page -- http://www.php.net/manual/en/function.filesize.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61477 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61477&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61477&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61477&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61477&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61477&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61477&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61477&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61477&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103005) next »