Programmatically determine maximum filename length
问题 How can I determine the maximum filename length on a linux box? Preferred in PHP programming language. 回答1: You want pathconf or fpathconf, which are not exposed (yet) in PHP. (When they are, they'll probably be posix_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 回答2: there's no need to programatically determine it. it's 255 bytes. edit: you can have longer