`

windows - Maximum Path Length Limitation

阅读更多

Maximum Path Length Limitation

In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string<NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)

Note  File I/O functions in the Windows API convert "/" to "\" as part of converting the name to an NT-style name, except when using the "\\?\" prefix as detailed in the following sections.

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of theGetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path".

Note  The maximum path of 32,767 characters is approximate, because the "\\?\" prefix may be expanded to a longer string by the system at run time, and this expansion applies to the total length.

The "\\?\" prefix can also be used with paths constructed according to the universal naming convention (UNC). To specify such a path using UNC, use the "\\?\UNC\" prefix. For example, "\\?\UNC\server\share", where "server" is the name of the computer and "share" is the name of the shared folder. These prefixes are not used as part of the path itself. They indicate that the path should be passed to the system with minimal modification, which means that you cannot use forward slashes to represent path separators, or a period to represent the current directory, or double dots to represent the parent directory. Because you cannot use the "\\?\" prefix with a relative path, relative paths are always limited to a total of MAX_PATH characters.

There is no need to perform any Unicode normalization on path and file name strings for use by the Windows file I/O API functions because the file system treats path and file names as an opaque sequence of WCHARs. Any normalization that your application requires should be performed with this in mind, external of any calls to related Windows file I/O API functions.

When using an API to create a directory, the specified path cannot be so long that you cannot append an 8.3 file name (that is, the directory name cannot exceedMAX_PATH minus 12).

The shell and the file system have different requirements. It is possible to create a path with the Windows API that the shell user interface is not able to interpret properly.

http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx

分享到:
评论

相关推荐

    Ultra-wide-dynamic-range gas sensing by optical pathlength multiplexed absorption spectroscopy

    Laser absorption spectroscopy (LAS) has become the most widely used laser spectroscopic technique for gas detection due to its ... To overcome the limitation on the dynamic range, this article reports op

    dwl-g122 b1 c1

    DWL-G122 (rev.B & rev.C) 15ML Windows Driver Release Note Setup Version: S0045 Build: 3, 3, 3, 1218 Utility: V3.40 (E) Windows 98/ME: 1.03.00.0000 (no pass WHQL) Windows 2000/XP: 1.03.00.0000 (pass ...

    DebugFactory3.zip

    However, DebugFactory does not include a compiler, and a compiler path must be set up before performing compilation. When compiling simply on a trial basis, the trial-version compiler incorporated ...

    IEC TS 61000-3-5-2009 Electromagnetic compatibility –Part 3-5

    IEC TS 61000-3-5-2009 Electromagnetic compatibility (EMC) –Part 3-5 Limits – Limitation of voltage fluctuations and flicker in low-voltage power supply systems for equipment with rated current ...

    TMS IntraWeb Component Pack v5.8 D2009-XE10

    TMS Components for IntraWeb allows rich design-time editing of webpages from the Delphi IDE ...TTIWTextAreaLimiter component : multi-line textbox with full client-side length limitation and display

    论文研究-Limitation of object-oriented language’s polymorphism.pdf

    面向对象编程语言中的多态性是一个关键的技术特性,它体现了面向对象编程的核心哲学,即通过不同的形式实现同一方法或操作。在多态性中,最常见的绑定方法是动态绑定或后期绑定。动态绑定允许在运行时决定调用哪个类...

    TMS.IntraWeb.Component.Pack.Pro.v.5.8.D2009-XE8

    TMS Components for IntraWeb allows rich design-time editing of webpages from the Delphi IDE ...TTIWTextAreaLimiter component : multi-line textbox with full client-side length limitation and display

    SJT11363 Limitation CN2006

    SJT11363 Limitation CN2006 国标

    TMS IntraWeb Components v5.8.1.0 for XE10.1 Full Source

    TMS Components for IntraWeb allows rich design-time editing of webpages from the Delphi IDE ...TTIWTextAreaLimiter component : multi-line textbox with full client-side length limitation and display

    低多边形图形制作软件

    Concept Farm....cause of action arising out of or relating to use of the Software or Data, including, without limitation, claims arising from malfunction or defects in the Software.

    netWindows_0.3.0_pre2

    A widget that provides a textarea with a twist: it can automatically expand acronyms and shorthand words into full strings of arbitrary length. Handy for text-intensive applications that involve ...

    Visual+Assist+X+10.9.2210

    3) PROFIT (you may see "License: trial" - don't worry, all should work without any limitation) Places where Visual Assist extension (va_x.dll and another stuff) resides in different versions of MS ...

    IBM3650M4驱动

    ServeRAID M and MR10 Series SAS Controller Driver for Windows Server 2003/2008/2008 R2 (also supports MegaRAID 8480 SAS Controller) Adapters Supported: IBM Flex System Storage Expansion Node (65Y8588...

    RTL8306E-CG_Realtek.pdf

    RTL8306E-CG规格书。The RTL8306E-CG is a 6-port Fast Ethernet switch controller that integrates ...• Port-based and queue-based rate limitation • 16-entry ACL for advanced packet control application

    Visual Assist 10.9.2212(亲测可用)

    3) PROFIT (you may see "License: trial" - don't worry, all should work without any limitation) Places where Visual Assist extension (va_x.dll and another stuff) resides in different versions of MS ...

    Generation of near transform-limited ultrashort laser pulses in kilohertz chirped-pulse amplification system by compensating high order phase distortions

    Using an acousto-optic programmable dispersive filter (AOPDF), the spectral full-width at half-maximum (FWHM) is expanded from 30 to 50 nm. Stable laser pulses with the duration of 30 fs (FWHM), ...

    Cisco.Press.CCIE.Routing.and.Switching.Exam.Quick.Reference.Sheets

    - Features hop-count limitation to prevent loops and stabilize the network. **Link-State Protocols** - **Examples:** OSPF, IS-IS - **Features:** - Sends local connection information to all nodes ...

    (1分下载网)Visual+Assist+X+通用破解补丁+10.9v2.291

    3) PROFIT (you may see "License: trial" - don't worry, all should work without any limitation) Places where Visual Assist extension (va_x.dll and another stuff) resides in different versions of MS ...

    Visual Assist 10.9 (2283.2)

    3) PROFIT (you may see "License: trial" - don't worry, all should work without any limitation) Places where Visual Assist extension (va_x.dll and another stuff) resides in different versions of MS ...

    Visual Assist 10.9 B2291.5

    3) PROFIT (you may see "License: trial" - don't worry, all should work without any limitation) Places where Visual Assist extension (va_x.dll and another stuff) resides in different versions of MS ...

Global site tag (gtag.js) - Google Analytics