#34498 [NEW]: is_dir isn't recognized?

From: Date: Wed, 14 Sep 2005 06:27:54 +0000
Subject: #34498 [NEW]: is_dir isn't recognized?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85011@lists.php.net to get a copy of this message
From:             johannes at jlindenbaum dot de
Operating system: Mac OS X 10.4.2
PHP version:      4.4.0
PHP Bug Type:     *General Issues
Bug description:  is_dir isn't recognized?

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 bug report at http://bugs.php.net/?id=34498&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34498&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34498&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34498&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34498&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34498&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34498&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34498&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34498&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34498&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34498&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=34498&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=34498&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34498&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34498&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34498&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34498&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34498&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34498&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34498&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34498&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#85011) next »