Skip to content
  • Chuck Atkins's avatar
    SystemTools: Use extended paths on Windows for > 256 length · 8f991ab0
    Chuck Atkins authored and Brad King's avatar Brad King committed
    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
    8f991ab0