Re: Getting Dir Size?
| From: | jeremy brand | Date: | Mon, 08 Jan 2001 23:13:05 +0000 |
| Subject: | Re: Getting Dir Size? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33344@lists.php.net to get a copy of this message | ||
@ signs hide errors. It is like saying error_reporting(0) for that
single function.
Jeremy
Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
Get your own Free, Private email at http://www.smackdown.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com
On Mon, 8 Jan 2001, Chris Anderson {Programmer Always} wrote:
> Date: Mon, 8 Jan 2001 13:37:39 -0500
> From: Chris Anderson {Programmer Always} <chrisderson@ameritech.net>
> To: Brian Clark <brianj@fusionwerks.com>,
PHP is not a drug . <php-general@lists.php.net>
> Subject: Re: [PHP] Getting Dir Size?
>
> Brian, in lots of functions like fopen, ive seen people add @ signs. What
> does that do? I have never used them
> ----- Original Message -----
> From: "Brian Clark" <brianj@fusionwerks.com>
> To: "PHP is not a drug ." <php-general@lists.php.net>
> Sent: Monday, January 08, 2001 4:26 PM
> Subject: Re: [PHP] Getting Dir Size?
>
>
> >
> > Hello Chris,
> >
> > (CAPA == "Chris Anderson {Programmer Always}") chrisderson@ameritech.net
> writes:
> >
> > CAPA> Is their a way to get the size of all the files in a dir with
> > CAPA> php?
> >
> > This doesn't traverse subdirectories, but it's a start.
> >
> > Hack away:
> >
> > <?php
> >
> > /* Untested code */
> >
> > $directory = '.'; /* current directory */
> > $size = 0;
> > $handle = @opendir($directory);
> > while($file = @readdir($handle))
> > {
> > if(! ereg("\.{1,2}$", $file))
> > {
> > if(! is_dir($file))
> > {
> > $array = stat($file);
> > $size += $array[7]; /* accumulative */
> > }
> > }
> > }
> > @closedir($handle);
> >
> > ?>
> >
> > -Brian
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>