ID: 37350 User updated by: k95vz5f02 at sneakemail dot com 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:
bjori: Sorry, I don't understand what you're trying to say. If you're suggesting that people have to use strcasecmp(realpath($a),realpath($b))==0 to test if two files are the same then: a) That is unintuitive and undocumented, certainly contrary to the principle of canonicalization. b) That wouldn't work on Linux etc. where multiple files can have the same name but differ in capitalisation. 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:21:43] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php strcasecmp() ------------------------------------------------------------------------ [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