not a valid Directory resource

From: Date: Wed, 18 Oct 2000 09:28:26 +0000
Subject: not a valid Directory resource
Groups: php.general 
Request: Send a blank email to php-general+get-20854@lists.php.net to get a copy of this message
Hello!! I want to handle directory. I wrote the following code. ================================================ <? $handle=dir('.'); echo "Directory handle: $handle->handle\n"; echo "Files:\n"; while (($file = $handle->read())!=false) { echo "$file<br>"; } $handle->close(); ?> ================================================ But the following error occurred. ================================================ Directory handle: Resource id #46 Files: Warning: 46 is not a valid Directory resource in /usr/local/apache/htdocs/test.php on line 6 Warning: 46 is not a valid Directory resource in /usr/local/apache/htdocs/test.php on line 10 ================================================ At first, my code worked fine. But from second execution, error message above displayed. I think that the setting of my PHP is wrong. What is wrong? PLZ help me. Any comment will be appreciated. TIA Taehoon, Kim in South Korea tae@fscm.co.kr

« previous php.general (#20854) next »