ID: 37350
Comment by: hanskrentel at yahoo dot de
Reported By: k95vz5f02 at sneakemail dot com
Status: Open
Bug Type: Filesystem function related
Operating System: Windows XP SP2
PHP Version: 5.1.4
New Comment:
within the windows OS there is no difference between cAsE in filenames,
a solution might be to read out the actual filename from the system and
return it by realpath.
but this won't be a valid solution afterall: next to case ignorance,
there are two filenames for a file as well: the long and the short
(8.3) one (since win/32/95 or FAT 32). so i guess a comparison will
fail in that case anyway.
additionally, for me another problem occurs:
c:\windows is a directory and could be name as c:\windows\ as well (in
my opinion it even should but that's my personal opinion anyway).
since for me there is no logical correct solution for this problem
anyway I would suggest to handle the windows filesystem more similar to
the *nix one, that meaning using / instead of \ for example to point to
directories with the needed / at the end. additionally, a virtual root
might be good idea as well sothat "c:\windows" would be "/c:/windows/"
afterall. this would help developers to create better cross platform
code. this might be already discussed somewhere else maybe.
Previous Comments:
------------------------------------------------------------------------
[2006-05-07 18:41:58] [EMAIL PROTECTED]
Realpath is also used internally for f.e. include_once, so this should
be looked into.
------------------------------------------------------------------------
[2006-05-07 18:08:28] k95vz5f02 at sneakemail dot com
Description:
------------
The realpath function doesn't canonicalize the case of the drive letter
on Windows (and possibly on certain other platforms).
For example:
realpath('C:\WINDOWS') returns 'C:\WINDOWS'
but realpath('c:\WINDOWS') returns 'c:\WINDOWS'
(note the different case of the 'C:')
Hence comparing realpaths cannot reliably be used to check that two
files are the same on Windows.
Reproduce code:
---------------
echo (realpath('C:\WINDOWS')==realpath('c:\WINDOWS')) ? "true" :
"false";
Expected result:
----------------
true
Actual result:
--------------
false
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37350&edit=1