Req #30383 [Opn->Fbk]: function reports: c:/ exists; c:/new not exists; c:/new/new exists;
| From: | cmb@php.net | Date: | Sun, 07 Jun 2015 23:24:23 +0000 |
| Subject: | Req #30383 [Opn->Fbk]: function reports: c:/ exists; c:/new not exists; c:/new/new exists; | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-193185@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=30383&edit=1
ID: 30383
Updated by: cmb@php.net
Reported by: federico at santulli dot it
Summary: function reports: c:/ exists; c:/new not exists;
c:/new/new exists;
-Status: Open
+Status: Feedback
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: Windows Server 2003
PHP Version: 4.3.9
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I can't reproduce this issue on Windows 7 with recent PHP
versions; not even with PHP 5.2.5.
Is that still an issue for others?
Previous Comments:
------------------------------------------------------------------------
[2004-10-10 19:11:04] federico at santulli dot it
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 this bug report at https://bugs.php.net/bug.php?id=30383&edit=1