From:             andy dot thoreson at verizon dot net
Operating system: Windows 2000
PHP version:      4.3.10RC1
PHP Bug Type:     Directory function related
Bug description:  is_dir reports a directory exists when named one thing but 
not another

Description:
------------
Was trying to write code that recursively scanned files in a directory
tree and Apache was crashing as soon as I added the recursion...but that's
another issue. In the course of debugging that, I found this one simple
bug:

I run the following code (nothing else run in php file):
print "1:[".is_dir("D:\Program Files\Apache
Group\Apache\htdocs\Utils\Old_Ocean_Backup")."]";
print "<br>";
print "2:[".is_dir("D:\Program Files\Apache
Group\Apache\htdocs\Utils\Old_Ocean_Backup\testx")."]";
print "<br>";

The first folder always comes back as existing (returns true/1). 

The second one does not. It is just a directory I made from windows
explorer (right-click, new folder).

When I rename it, in explorer, to "abc" and reload the php page (with name
changed from "testx" to "abc" in code as well), is_dir says it *does*
exist. Renaming to "abcx" or "testxx" etc does the same..."abcx" exists,
"textxx" does not.

Renaming it back and forth from explorer reproduces the same results.

File system rights don't seem to be the issue.

Strangely, readdir does see the directory such as:
$handle=opendir("D:\Program Files\Apache
Group\Apache\htdocs\Utils\Old_Ocean_Backup");
while ($file = readdir($handle)) {
...}

Installed a fresh version of PHP and Apache today after first running into
problem (was on apache 2.0 and PHP 4.3 from last week): 
PHP 4.3.10RC2-dev.
Apache 1.3
Windows NT 5.0 build 2195 (Windows 2000)

Reproduce code:
---------------
See description

Expected result:
----------------
Expected the code to treat the existance of a directory the same
regardless of its name.

Actual result:
--------------
Code treats the existance of a directory different based on directory
name.


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

Reply via email to