ID: 39198
Updated by: tony2001@php.net
Reported By: php dot spam at frogblender dot net
-Status: Open
+Status: Feedback
Bug Type: Directory function related
Operating System: Windows 2003
PHP Version: 5.1.6
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-10-19 14:00:37] php dot spam at frogblender dot net
Description:
------------
If you have a directory where Everyone has "Full Control" rights you
would expect is_dir to return true but it doesn't.
This bug has existed since 5.0.0 and I've had this problem on at least
three servers during the past year.
I'm lying about my PHP version (it's really 5.1.4) but I've checked the
change log.
realpath() seem to exhibit the proper behavior.
Reproduce code:
---------------
<?php
print("<pre>");
error_reporting(E_ALL);
#clearstatcache();
$paths = array(
"C:\\",
"C:\\Windows",
"C:\\Windows\\Temp",
"C:\\Windows\\Temp\\RP_Compile",
"C:\\Windows\\Temp\\DoesNotExist",
"C:\\Windows\\Temp\\RP_Compile\\Subdir",
);
print("\nis_dir()\n");
foreach($paths as $path)
print(is_dir($path) . " \t$path\n");
print("\nrealpath()\n");
foreach($paths as $path)
print(!(realpath($path) === FALSE) . " \t$path\n");
print("\nstat()\n");
foreach($paths as $path)
print(!(stat($path) === FALSE) . " \t$path\n");
print("</pre>");
?>
Expected result:
----------------
is_dir()
1 C:\
1 C:\Windows
1 C:\Windows\Temp
1 C:\Windows\Temp\RP_Compile
C:\Windows\Temp\DoesNotExist
1 C:\Windows\Temp\RP_Compile\Subdir
realpath()
1 C:\
1 C:\Windows
1 C:\Windows\Temp
1 C:\Windows\Temp\RP_Compile
C:\Windows\Temp\DoesNotExist
1 C:\Windows\Temp\RP_Compile\Subdir
Actual result:
--------------
Notice the different result for "C:\Windows\Temp\RP_Compile"
is_dir()
1 C:\
1 C:\Windows
1 C:\Windows\Temp
C:\Windows\Temp\RP_Compile
C:\Windows\Temp\DoesNotExist
1 C:\Windows\Temp\RP_Compile\Subdir
realpath()
1 C:\
1 C:\Windows
1 C:\Windows\Temp
1 C:\Windows\Temp\RP_Compile
C:\Windows\Temp\DoesNotExist
1 C:\Windows\Temp\RP_Compile\Subdir
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39198&edit=1