note 37879 rejected from function.stat by pollita

From: Date: Mon, 01 Dec 2003 05:05:27 +0000
Subject: note 37879 rejected from function.stat by pollita
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-61189@lists.php.net to get a copy of this message
Note Submitter: greenie@oddpost.com ---- I was hoping someone could help with a problem I'm having... I'm trying to determine the total size of a particular directory, but the stat function always returns 0 when it is pointed to a directory instead of a file. Here's the code I'm using: $aryDirectoryStats = stat( "c:/mydirectory/" ); $intDirectorySize = $aryDirectoryStats["size"]; echo( "Directory size: " . $intDirectorySize . " bytes" ); clearstatcache(); However, if I modify the first line slightly so it points to a file instead of a directory, it works fine: $aryDirectoryStats = stat( "c:/mydirectory/myfile.foo" ); Any insights? I'm running PHP 4.3.4 (Apache 1.3 / WinXP).

« previous php.notes (#61189) next »