Re: directory size?

From: Date: Thu, 03 Apr 2003 22:45:58 +0000
Subject: Re: directory size?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-142210@lists.php.net to get a copy of this message
At 00:40 04.04.2003, Mantas Kriauciunas said: --------------------[snip]-------------------- >Hey >I looked up in the manual but found only >Disk_total_space >Disk_free_space > >Is there anything like total_space for directory? >Or I will have to think of something else? >Like counting every file size and adding it to total. >But if there is like 1000 files with directories in the main directory. >It will take time to count files from all the directories and output >total size of the main directory. --------------------[snip]-------------------- In case you're on Linux, and may run externals, you could du -s . (prints kilobytes) du -s -b (prints bytes) list($dusage, $dir) = explode(' ', du -s -b .); echo sprintf('The current directory has %d kB (%d bytes)', $dusage / 1024, $dusage); -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#142210) next »