I was doing some reading this evening (I know, BORING) about the NT CreateFile
API, and found something quite interesting.
It's documented that the WIDE version of the API supports very long file names.
I quote from Microsoft's documentation
Windows NT: You can use paths longer than MAX_PATH characters by calling the
wide (W) version of CreateFile and prepending "\\?\" 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. However, each component in the path cannot be more
than
MAX_PATH 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, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and
"\\?\UNC\tom_1\hotstuff\coolapps" is seen as "\\tom_1\hotstuff\coolapps".
This would seem to indicate that if ADSM were to use the W version of the API,
then the problems of these really deep directory structures could be solved.
Comments ????
Peter
From: Andrew Raibeck <storman AT US.IBM DOT COM> on 06/26/98 06:29 PM GMT
Please respond to "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
To: ADSM-L AT VM.MARIST DOT EDU
cc: (bcc: ADSM)
Subject: Re: ADSM Filename Limitations???
This is actually an NT limitation. Here is an excerpt from Microsoft's Visual
C++ documentation:
================================
Path Field Limits
#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
The sum of the fields should not exceed _MAX_PATH.
================================
I then wrote the following trivial C++ program to display these values:
#include <windows.h>
#include <iostream.h>
int main()
{
cout << "_MAX_DRIVE = " << _MAX_DRIVE << ".\n";
cout << "_MAX_DIR = " << _MAX_DIR << ".\n";
cout << "_MAX_EXT = " << _MAX_EXT << ".\n";
cout << "_MAX_FNAME = " << _MAX_FNAME << ".\n";
cout << "_MAX_PATH = " << _MAX_PATH << ".\n";
return 0;
}
Here is the output from the program:
_MAX_DRIVE = 3.
_MAX_DIR = 256.
_MAX_EXT = 256.
_MAX_FNAME = 256.
_MAX_PATH = 260.
I've been able to "trick" Explorer into creating pathnames longer than these
limitations, but then the directories and files therein are not accessible to
me (Windows complains that it can't find the file or that the path name is too
long).
I don't know how programs like inernet browsers get away with creating and
accessing pathnames that exceed these limitations, but ADSM uses the standard
Windows 32-bit API calls, which don't allow for pathnames that exceed the above
limits.
Andy
Andy Raibeck
IBM Storage Systems Division
ADSM Client Development
e-mail: storman AT us.ibm DOT com
ADSM-L AT VM.MARIST DOT EDU on 06/26/98 09:41:11 AM
Please respond to ADSM-L AT VM.MARIST DOT EDU
To: ADSM-L AT VM.MARIST DOT EDU
cc:
Subject: ADSM Filename Limitations???
Greetings,
Does anyone know if there are limitations on the path and/or filename that
ADSM will sucessfully backup? I'm using ADSM Version 3 on NT with a Version
2 NT client. One of our customers has gone 'crazy' and has begun using
paths and filenames greater than 256. I was under the impression that
whatever the filesystem could address, ADSM could backup, but nightly
backups have failed when these files are encountered.
Any suggestions would be greatly appreciated.
Christopher Bushman
NT Technical Services
AMP Incorporated
81(0-2589)
cbushman AT amp DOT com
|