#37687 [Opn->Fbk]: file_exists strange behavior on windows platform only
| From: | nlopess@php.net | Date: | Mon, 14 Aug 2006 21:58:42 +0000 |
| Subject: | #37687 [Opn->Fbk]: file_exists strange behavior on windows platform only | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100794@lists.php.net to get a copy of this message | ||
ID: 37687
Updated by: nlopess@php.net
Reported By: pear at laurent-laville dot org
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: win32 only
PHP Version: 5.1.4, 4.4.2
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
I can't reproduce it.
Previous Comments:
------------------------------------------------------------------------
[2006-06-03 13:52:47] pear at laurent-laville dot org
Description:
------------
Concat directory name without trailing dir separator, and a file name.
While i was ready to prepare a new release of PEAR_PackageFileManager
(PFM), and generate the new package.xml, i found a bug. I thought first
it was from PFM, but then i investigate a bit more, and i found :
It will occurs only under Windows platform, because it works fine under
Unix.
I have :
- this "E:\pearix-dev\pfm15x" directory exists
- this "E:\pearix-dev\pfm15xpackage.xml" (file | dir) does not exists
- my test script into "E:\pearix-dev\pfm15x" directory
Tested under PHP 5.1.4 and PHP 4.4.2 under windows, with Apache 2.0.55
gave WRONG results
Tested under PHP 5.1.4 and PHP 4.4.0 under Unix with Apache 2.2.2 gave
GOOD (expected) results.
Feedback are welcome !
Laurent Laville
Reproduce code:
---------------
<?php
$outputdir = dirname(__FILE__); // "E:\pearix-dev\pfm15x"
$packagefile = 'package.xml';
var_dump($outputdir);
var_dump($outputdir . $packagefile);
if (file_exists($outputdir . $packagefile)) {
var_dump('condition 1 passed');
}
if (is_writable($outputdir . $packagefile)) {
var_dump('condition 2 passed');
}
if ((file_exists($outputdir . $packagefile) &&
is_writable($outputdir . $packagefile))) {
var_dump('condition 3 passed');
}
?>
Expected result:
----------------
None of "condition x passed" message displayed, but only
string(20) "E:\pearix-dev\pfm15x"
string(31) "E:\pearix-dev\pfm15xpackage.xml"
Actual result:
--------------
The 3 conditons are TRUE
string(20) "E:\pearix-dev\pfm15x"
string(31) "E:\pearix-dev\pfm15xpackage.xml"
string(18) "condition 1 passed"
string(18) "condition 2 passed"
string(18) "condition 3 passed"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37687&edit=1