Hello!
... while the maximum length allowed by the file system is 256.
"How can I use path names longer than 255 characters?"
http://www.windowsitpro.com/Article/Art ... 14607.htmlA. Windows NT has a maximum path size defined as MAX_PATH which is 255 characters. It is possible to use more characters by calling the wide (W) version of CreateFile and prefixing "\\?\" to the path. The "\\?\" tells the function to turn off path parsing. This lets you use paths that are nearly 32,000 Unicode characters long. You must use fully-qualified paths with this technique. This also works with UNC names.
The "\\?\" is ignored as part of the path.
For example, "\\?\D:\documents\faq.txt" is seen as "D:\documents\faq.txt".
Programs expecting to find legal file lengths may fall over attempting to open a file with a long path. If, for example the buffer they are putting the path into expects a legal file length.
http://www.osronline.com/showThread.CFM?link=91868The maximum length of a file/folder is a problem. Almost everything in
Windows uses a MAXIMUM_FILENAME_LENGTH of 256 and MAX_PATH of 260. But
there is also a MAXPATHLEN parameter which is 1024. Any single element of
the path is limited to 255 characters.
But the Unicode versions of several functions permit a maximum path length
of 32,767 characters, composed of components up to 255 characters in length.
To specify such a path, use the "\\?\" prefix. For example,
"\\?\D:\<path>". But many functions don't handle this.
So 260 *usually* works, but 32K is guaranteed to work. (Note that this is
characters, not bytes -- each Unicode character is 2 bytes.)
http://www.cygwin.com/ml/cygwin/2004-10/msg01330.htmlCreateFileA on an nt-based system just converts all strings from MBCS to
Unicode via the current locale's code page, and then calls CreateFileW.
CreateFileA is always limited to MAX_PATH.
On Win98/WinME, it works differently. There is no routine called
NtCreateFile.
CreateFileW is a dummy routine that always returns an error, unless you
link with the Microsoft Layer for Unicode (Unicows.dll). Unicows.dll
translates all UNICODE argument strings to the current code page, and
calls CreateFileA.
So you can always link with CreateFileW, since it always exists, but it
may not be functional.
The special \\?\ prefix doesn't do what you want on Win9x systems, as you
always go through CreateFileA, so paths are always limited to MAX_PATH.
http://msdn.microsoft.com/library/defau ... a_file.aspRoman