RE: [PHP] Disk Usage
| From: | Matthew Loff | Date: | Sun, 23 Sep 2001 18:27:11 +0000 |
| Subject: | RE: [PHP] Disk Usage | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68432@lists.php.net to get a copy of this message | ||
Try removing the typecast to (int)...
$usage =
du -sk;
See if that works. If not, then either your backtick operators aren't
working (is safe mode on?) or du isn't being executed (not in the PATH
environment variable?).
-----Original Message-----
From: Scott Poarch [mailto:scott@globalhost.com]
Sent: Sunday, September 23, 2001 4:11 AM
To: Matthew Loff; 'Steve Werby'; php-general@lists.php.net
Subject: Re: [PHP] Disk Usage
Well, it's an intriquing idea, but I'm not getting any success out of
it. thanks for the suggestion. I'll keep plugging away.
--
Scott Poarch
http://www.globalhost.com
- - - - - - - - - - - -
> From: "Matthew Loff" <matt@willetts.com>
> Organization: Willetts Systems
> Date: Sat, 22 Sep 2001 23:13:25 -0400
> To: "'Scott Poarch'" <scott@globalhost.com>, "'Steve
Werby'"
> <steve-lists@befriend.com>, <php-general@lists.php.net>
> Subject: RE: [PHP] Disk Usage
>
>
> Yes, that's exactly what I'm suggesting...
>
> Say output of du -sk is:
>
> 1022 .
>
> The dot represents the current directory. By typecasting it to an
> integer, using (int), PHP will drop the dot and whitespace in
> between...
>
> So, typecasting "1022 ." to int gives you 1022 by itself.
>
> Good luck!
> -Matt
>
>
> -----Original Message-----
> From: Scott Poarch [mailto:scott@globalhost.com]
> Sent: Saturday, September 22, 2001 10:37 PM
> To: Matthew Loff; 'Steve Werby'; php-general@lists.php.net
> Subject: Re: [PHP] Disk Usage
>
>
> I appreciate the help.
>
> I understand the 'du -sk', but what's the "(int)" all about. Are you
> suggesting using:
>
> $usage = (int)du -sk;
>
> in the PHP code, as in:
>
> chdir($basedir);
> $usage = (int)'du -sk';
> print("$usage is usage");
>
> ?
>
> Thanks,
> --
> Scott Poarch
> http://www.globalhost.com
> - - - - - - - - - - - -
>
>> From: "Matthew Loff" <matt@willetts.com>
>> Organization: Willetts Systems
>> Date: Sat, 22 Sep 2001 22:07:26 -0400
>> To: "'Scott Poarch'" <scott@globalhost.com>, "'Steve
Werby'"
>> <steve-lists@befriend.com>, <php-general@lists.php.net>
>> Subject: RE: [PHP] Disk Usage
>>
>> $usage = (int)du -sk;
>
>