chdir() to the directory you want the size of, and do:
$usage = (int)`du -sk`; // size in kilobytes
$usage = (int)`du -sb`; // size in bytes
Now $usage will have the size in integer form.
-----Original Message-----
From: Scott Poarch [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 22, 2001 9:00 PM
To: Steve Werby; [EMAIL PROTECTED]
Subject: Re: [PHP] Disk Usage
Thanks for the quick reply.
I've been tring variations on that for a while with little success. This
is not necessarily my best hope, but it's the version I happen to be at
at the
moment:
$command = "du > test2";
system($command);
Any ideas?
--
Scott Poarch
http://www.globalhost.com
- - - - - - - - - - - -
> From: "Steve Werby" <[EMAIL PROTECTED]>
> Organization: Befriend Internet Services LLC
> Date: Sat, 22 Sep 2001 20:44:32 -0400
> To: "Scott Poarch" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Disk Usage
>
> "Scott Poarch" <[EMAIL PROTECTED]> wrote:
>> I'm trying to find a script that will return the same kind of data I
>> get with du. I want a page to list current disk usage by virtual
>> domain on our servers. I see the diskfreespace and disk_total_space
>> commands, but they doesn't seem to work at all for me.
>
> If you're on Linux or another un*x, try calling 'du' using system() or
> a similar command.
>
> --
> Steve Werby
> President, Befriend Internet Services LLC http://www.befriend.com/
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]