How can I determine the maximum filename length on a linux box?
Preferred in PHP programming language.
How can I determine the maximum filename length on a linux box?
Preferred in PHP programming language.
On
The maximum file length for most linux file systems is 255. You're probably best off using that as a generic constant and modifying to fit your known file system in linux. Here's a nice comparison of the file systems that might be used. Max file length is listed there.
You want
pathconforfpathconf, which are not exposed (yet) in PHP. (When they are, they'll probably beposix_pathconf.)You may also shell out to
getconf, a command-line utility interface to the same functionality. Try this on your system:$ getconf NAME_MAX /tmp$ getconf PATH_MAX /tmp