note 36887 added to function.filesize

From: Date: Sun, 26 Oct 2003 09:23:09 +0000
Subject: note 36887 added to function.filesize
Groups: php.notes 
Request: Send a blank email to php-notes+get-59301@lists.php.net to get a copy of this message
this function returns the size of $file whether or not it is a directory. function fsize($file){ $size; if(is_dir($file)) if ($dh = opendir($file)) while (($filecnt = readdir($dh)) !== false) { if($filecnt == "." || $filecnt == "..")continue; if(is_dir($file."/".$filecnt)) $size += fsize($file."/".$filecnt); else $size += filesize($file."/".$filecnt); } else return false; else $size = filesize($file); return $size; } ---- Manual Page -- http://www.php.net/manual/en/function.filesize.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36887 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36887&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36887&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#59301) next »