ID: 37918 Updated by: [EMAIL PROTECTED] Reported By: mrueegg at metaworx dot ch -Status: Open +Status: Assigned Bug Type: Filesystem function related Operating System: Windows NT 5.1 build 2600 (WiXP) PHP Version: 5CVS-2006-06-26 (snap) -Assigned To: +Assigned To: nlopes New Comment:
Nuno, IIRC you fixed the previous one, could you please check this out too? Previous Comments: ------------------------------------------------------------------------ [2006-06-26 16:01:16] mrueegg at metaworx dot ch Description: ------------ on my windows system the function file_exists() returns true whenever the full qualified file path has more than a total of 259 characters. if the path is relative, the cwd will be prepended and counted (e.g. 260-28=232). i testet it with the snapshot of today (26-Jun-2006 16:19) as well. plain php.exe, no changes to modules or php.ini. same result. i use an immaginary filename in the root of 'C:\'. the file obviously does not exist. refer to http://bugs.php.net/bug.php?id=31347 describing the similar error with strlen > 255. Reproduce code: --------------- <?php echo php_uname(); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { echo "Running on Windows with PHP ", phpversion(), "\n"; $root = "c:".DIRECTORY_SEPARATOR; } else { die("problem could not be reproduced on linux (debian with PHP 5.1.2-1+b1)\n"); } $max = 260; $t = $root.str_repeat('x', $max - strlen($root)); var_dump(strlen($t)); var_dump(file_exists($t)); $t = $root.str_repeat('x', $max - strlen($root) - 1); var_dump(strlen($t)); var_dump(file_exists($t)); echo "\nif no root is given, then cwd is prepended:\n"; var_dump(getcwd().DIRECTORY_SEPARATOR); var_dump(strlen(getcwd().DIRECTORY_SEPARATOR)); echo "\n"; $t = str_repeat('x', $max - strlen(getcwd().DIRECTORY_SEPARATOR)); var_dump(strlen($t)); var_dump(file_exists($t)); $t = str_repeat('x', $max - strlen(getcwd().DIRECTORY_SEPARATOR) - 1); var_dump(strlen($t)); var_dump(file_exists($t)); Expected result: ---------------- Windows NT MWXDEV 5.1 build 2600 Running on Windows with PHP 5.1.4 int(260) bool(false) int(259) bool(false) if no root is given, then cwd is prepended: string(28) "P:\Programming\xampp\htdocs\" int(28) int(232) bool(false) int(231) bool(false) an exception/warning would also be acceptable. but in case of doubt the function should return false. Actual result: -------------- Windows NT MWXDEV 5.1 build 2600 Running on Windows with PHP 5.1.4 int(260) bool(true) int(259) bool(false) if no root is given, then cwd is prepended: string(28) "P:\Programming\xampp\htdocs\" int(28) int(232) bool(true) int(231) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37918&edit=1