Edit report at https://bugs.php.net/bug.php?id=50197&edit=1
ID: 50197 Comment by: php at stock-consulting dot com Reported by: jandidrik dot fagerlid at hotmail dot com Summary: long filenames Status: Assigned Type: Feature/Change Request Package: Filesystem function related Operating System: winxp 32bit PHP Version: 5.3.0 Assigned To: pajoye Block user comment: N Private report: N New Comment: Apparently, the path length limit exists for other PHP functions as well. For example, glob() fails to return files when the length of the file name including it's path exceeds 240...260 characters (unsure of the precise limit). There is no warning, it just silently gives the wrong result. In my case, it's PHP 5.3.6 running as a CLI script on Ubuntu 11.10, the files in question reside on a network share (host: Win7). Shell commands like "ls" display all directory entries correctly, so the OSes appear to work okay. I tried to change the shell's CWD to the network directory and to run the script there, but the issue remained. Apparently, PHP doesn't consider the current working directory, but the "real path", which remains too long. Previous Comments: ------------------------------------------------------------------------ [2009-11-16 22:40:22] jandidrik dot fagerlid at hotmail dot com Description: ------------ Firstly, thank you for your hard work, it is appreciated. It seems filemtime will not accept file paths longer than 256 chars. I have some long dir names consisting of totally 165 chars, and a file inside it consisting of 94 chars. The script doesnt exit, but i get a warning and a NULL result. Warning: filemtime() [function.filemtime]: stat failed for [file.php] in [dir] on line # Reproduce code: --------------- #$path = string 165 chars #$file = string of 94 chars filemtime($path."/".$file); Expected result: ---------------- timestamp for file Actual result: -------------- NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=50197&edit=1