#30383 [NEW]: function reports: c:/ exists; c:/new not exists; c:/new/new exists;
| From: | federico at santulli dot it | Date: | Sun, 10 Oct 2004 17:11:07 +0000 |
| Subject: | #30383 [NEW]: function reports: c:/ exists; c:/new not exists; c:/new/new exists; | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-67365@lists.php.net to get a copy of this message | ||
From: federico at santulli dot it
Operating system: Windows Server 2003
PHP version: 4.3.9
PHP Bug Type: Feature/Change Request
Bug description: function reports: c:/ exists; c:/new not exists; c:/new/new exists;
Description:
------------
using server 2003 with iis6
a file_exists used on a tree of directory reports:
file_exists("c:") = true
file_exists("c:/new") = false
file_exists("c:/new/new") = true
second call is wrong.
it happens with all first directories on a drive root
Reproduce code:
---------------
<?
mkdir("d:/new",0777);
mkdir("d:/new/new",0777);
$dir = "d:/new/new";
$dir_parts = preg_split('!/+!', $dir, -1,
PREG_SPLIT_NO_EMPTY);
$new_dir = ($dir{0} == '/') ? '/' : '';
foreach ($dir_parts as $dir_part) {
$new_dir .= $dir_part;
if(file_exists($new_dir)) {
echo "$new_dir exists\n";
}
else {
echo "$new_dir doesn't exists\n";
}
$new_dir .= '/';
}
?>
Expected result:
----------------
d: exists
d:/new exists
d:/new/new exists
Actual result:
--------------
d: exists
d:/new doesn't exists
d:/new/new exists
--
Edit bug report at http://bugs.php.net/?id=30383&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30383&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30383&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30383&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30383&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30383&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30383&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30383&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30383&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30383&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30383&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30383&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30383&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30383&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30383&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30383&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30383&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30383&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30383&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30383&r=mysqlcfg