#34498 [Opn->Bgs]: is_dir isn't recognized?

From: Date: Wed, 14 Sep 2005 07:30:00 +0000
Subject: #34498 [Opn->Bgs]: is_dir isn't recognized?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85014@lists.php.net to get a copy of this message
 ID:               34498
 Updated by:       sniper@php.net
 Reported By:      johannes at jlindenbaum dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         *General Issues
 Operating System: Mac OS X 10.4.2
 PHP Version:      4.4.0
 New Comment:

The full path to the directories must be readable by the apache user
for this to work. Never rely on the "left-overs" to be really readable
and usable files.


Previous Comments:
------------------------------------------------------------------------

[2005-09-14 08:27:53] johannes at jlindenbaum dot de

Description:
------------
Hi,

Don't know if it's just me but XAMPP distrib with php 4.4.0 running
parsing following PHP code doesn't work.

Clearly the $handle directory I am reading contains directories. These
are not recognized and thus not put into the array!

htdocs in Apache has full 777 for developing purposes.

Reproduce code:
---------------
$directories = array();
while( FALSE !== ($file_names = readdir($handle)) ) {
	if( $file_names != "." && $file_names != "..") {
		if( !is_dir($file_names) ) {
			echo $file_names;
		}
		else {
			$directories[]	= $file_names;
		}
	}
}

Expected result:
----------------
I expect directories found in the read directory to be added into the
$directories array.

Actual result:
--------------
Directory is outputted as if it were a file.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34498&edit=1


Thread (4 messages)

« previous php.bugs (#85014) next »