CountScubula wrote:
"Nate Harel" <nh****@nettech-services.net> wrote in message
news:3f**********************@news.rcn.com...
Hi all,
I need to write a small script that gives me the size of a particular
directory. Is there a command or set of commands that will do this?
thanks
Nate
use this, then print to see how it looks
$dir = "/some/dir/";
$res = `df -c $dir`;
print $res;
--
Mike Bradley
http://gzen.myhq.info -- free online php tools
You might want to consider using disk_total_space()
$dir = "/path/to/dir";
$size_in_bytes = disk_total_space($dir);
$size_in_k = $size_in_bytes / 1024;
There's some discussion about this here:
http://www.php.net/manual/en/functio...otal-space.php
Yeah, I'd have thought that disk_total_space would give you the size of
the entire disk, not a directory. /shrug =)
Warm regards,
- Dan
dantripp.com