How big a buffer should be provided for file names including fully qualified path for portability under all versions of Windows. Is there any constant
available in the Windows SDK for this?
Yes I am sure. The whole file name (including path) cannot exceed 260 characters. If you create a file with long name (say 256 characters) you cannot move it in a deeper folder tree. It can only be created on the root directory. If you try move the file to a folder and the whole file name and path exceeds the limits, Windows denies this attempt and throws a file system error.
The complete file name together with the path MUST not exceed the MAX_PATH limit. This also includes the two spaces reserved for enclosing quotes (") used by Windows which means that the maximum limit to file name and path is 258 characters.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.