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/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php