我正在尝试为 Mac OS X 上完整路径字符串的最大长度找到一个明确的答案(例如 Apple 开发人员文档)。我已经看到各种非权威网站声明它是无限的,4096 个字符, 或 1024 个字符,但无法在 Apple 的网站上找到答案。
最佳答案
如果您在 Leopard 系统上查看 /usr/include/sys/syslimits.h
,您会看到:
#define PATH_MAX 1024 /* max bytes in pathname */
此外,Technical Note 1150: HFS Plus Volume Format ,在讨论符号链接(symbolic link)时说:
"For maximum compatibility, the length of the path should be 1024 bytes or less."
关于macos - Mac OS X HFS+ 中最长的路径名字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1295135/