Re: How to check if a dir is empty?
| From: | Cynic | Date: | Wed, 20 Dec 2000 14:50:23 +0000 |
| Subject: | Re: How to check if a dir is empty? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31208@lists.php.net to get a copy of this message | ||
Slightly modified example from
http://docs.wad.cz/php/class.dir.html
$d = dir( $dir );
$list = array() ;
while( $list[] = $d->read() ) {
}
$d->close();
if( 2 == sizeof( $list ) ) {
echo "$dir is empty" ;
}
At 11:55 20.12. 2000, Tan JH wrote the following:
--------------------------------------------------------------
>Hi,
>
> Can anyone please tell me how to check if a directory is empty?
>Thanks....
>
>Rgds,
> JH
>___________________________________________________________________________
>Visit http://www.visto.com/info, your free web-based
>communications center.
>Visto.com. Life on the Dot.
>
>
>--
>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
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz