Skip to content
Snippets Groups Projects
Commit 8f991ab0 authored by Chuck Atkins's avatar Chuck Atkins Committed by Brad King
Browse files

SystemTools: Use extended paths on Windows for > 256 length

Many Windows filesystem calls (but not all) have a MAX_PATH limitation
of 260 characters (drive letter, colon, backslash, 256 char path, null).
This is especially problematic for interacting with large highly nested
build trees (the boost C++ libraries, for example). This limitation can
be overcome by using extended length paths instead.  By converting
local filesystem and network paths to extended length paths before
passing them to the underlying APIs the maximum path length can be as
large as 32767 characters. The new ConvertToWindowsExtendedPath
function will convert "E:/a.txt" to "\\?\E:\a.txt" and "\\Foo\a.txt" to
"\\?\UNC\Foo\a.txt".

See also the MSDN article on "Naming Files, Paths, and Namespaces":

 http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx

This also adds a hidden CMake option, KWSYS_TEST_SYSTEMTOOLS_LONG_PATHS,
which, when set to TRUE, will enable the extended length path tests.
This is off by default since if something does go awry, the resulting
leftovers could be difficult to delete manually.

Change-Id: Ib7ac1f657241ed389169678d1c078c0d836f1c7b
parent 97817ce7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment