路径字段限制Path Field Limits

语法Syntax

#include <stdlib.h>  

备注Remarks

这些常量定义路径的最大长度以及路径内的单个字段的最大长度。These constants define the maximum length for the path and for the individual fields within the path.

常量Constant 含义Meaning
_MAX_DIR 目录组件的最大长度Maximum length of directory component
_MAX_DRIVE 驱动器组件的最大长度Maximum length of drive component
_MAX_EXT 扩展组件的最大长度Maximum length of extension component
_MAX_FNAME 文件名组件的最大长度Maximum length of filename component
_MAX_PATH 完整路径的最大长度Maximum length of full path

备注

C 运行库支持的路径的最大长度为 32768 个字符,但这取决于操作系统(特别是文件系统)支持这些较长的路径。The C Runtime supports path lengths up to 32768 characters in length, but it is up to the operating system, specifically the file system, to support these longer paths. 字段长度的总和不应超过 _MAX_PATH 以便与 FAT32 文件系统完全向后兼容。The sum of the fields should not exceed _MAX_PATH for full backwards compatibility with FAT32 file systems. --- --- Windows 2000Windows 2000、--- --- Windows XP Home Edition、Windows XP Professional、Windows Server 2003Windows XP Home Edition, Windows XP Professional, Windows Server 2003、--- --- Windows Server 2003Windows Server 2003 和 Windows Vista NTFS 文件系统支持的路径的最大长度为 32768 个字符(但仅在使用 Unicode API 时才支持)。, --- --- Windows XP Home Edition、Windows XP Professional、Windows Server 2003Windows XP Home Edition, Windows XP Professional, Windows Server 2003, --- --- Windows Server 2003Windows Server 2003, and Windows Vista NTFS file system supports paths up to 32768 characters in length, but only when using the Unicode APIs. 在使用较长的路径名时,为路径添加字符 \\?\ 作为前缀,并使用 Unicode 版本的 C 运行时函数。When using long path names, prefix the path with the characters \\?\ and use the Unicode versions of the C Runtime functions.

另请参阅See Also

全局常量Global Constants