In message <d4fta3$5hg$1@godfrey.mcc.ac.uk>, Roy Schestowitz
<newsgroups@schestowitz.com> writes
Jeff Gaines wrote:
<snip>
MAX_PATH is defined in the Windows API as 256 and is the maximum length
of a full path to a file (including its name and extension).
Why isn't that common knowledge? And where is standardisation?
<snipped>
In the copy of the Microsoft Platform SDK that I have (August 2001),
MAX_PATH is defined as 260 (and in all the other versions that I can
remember seeing). It can be circumvented. This is what the Microsoft
Platform SDK (August 2001) says:
'The globally defined constant MAX_PATH defines the maximum number of
characters a path can have. You can avoid this constraint by doing both
of the following:
Referring to volumes by their unique volume names, which have \\?
prepended to the path.
Using Unicode so that you use the Unicode (W) versions of file
functions, which support the \\? prefix.
The \\?\ turns off path parsing. By using this form, you can work with
paths that are nearly 32,000 Unicode characters long. However, each
component in the path cannot be more than a file-system-specific value
indicated by the function GetVolumeInformation. You must use full paths
with this technique. This technique also works with universal naming
convention (UNC) names such as "\\OtherComputer\Directory\Filename.ext".
The \\?\ is ignored as part of the path example, and
"\\?\C:\myworld\private" is seen as "C:\myworld\private".'
It may not be common knowledge, but it is certainly freely available
knowledge. The latest Microsoft Platform SDK can be downloaded for free
(call charges might apply) from
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
There is a lot of good stuff available there. Alternatively, you can
search/browse the SDK online at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdkintro
/sdkintro/devdoc_platform_software_development_kit_start_page.asp
Regards
Pete
--
Peter Scales
|
|