Req #50197 [Asn->Nab]: long filenames
| From: | pajoye@php.net | Date: | Tue, 15 Oct 2013 12:13:51 +0000 |
| Subject: | Req #50197 [Asn->Nab]: long filenames | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182281@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50197&edit=1
ID: 50197
Updated by: pajoye@php.net
Reported by: jandidrik dot fagerlid at hotmail dot com
Summary: long filenames
-Status: Assigned
+Status: Not a bug
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:
Not a bug, but the 255 path length limit on Windows with ANSI APIs.
Previous Comments:
------------------------------------------------------------------------
[2011-12-13 15:36:02] php at stock-consulting dot com
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.
------------------------------------------------------------------------
[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