[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Long path names in windows

From: Colin JN Breame <colin_at_breame.com>
Date: 2004-10-28 11:32:38 CEST

C. Michael Pilato wrote:

>Stefano Spinucci <virgo977virgo@yahoo.it> writes:
>
>I've done recent searches around this too, and I'm afraid your
>information is incomplete. If you use the Unicode versions of the
>path-related functions we're discussing (CreateFile and friends), and
>are on a Win2k or better version of the OS, you can get a 32k path:
>
> In the ANSI version of this function, the name is limited to
> MAX_PATH characters. To extend this limit to 32,767 wide
> characters, call the Unicode version of the function and prepend
> "\\?\" to the path. For more information, see Naming a File[1]
>
>[1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/naming_a_file.asp
>
>
>
apr/file_io/win32/open.c: utf8_to_unicode_path

if (srcremains > MAX_PATH) {
        if (srcstr[1] == ':' && (srcstr[2] == '/' || srcstr[2] == '\\')) {
            wcscpy (retstr, L"\\\\?\\");
            retlen -= 4;
            t += 4;
        }
        else if ((srcstr[0] == '/' || srcstr[0] == '\\')
              && (srcstr[1] == '/' || srcstr[1] == '\\')
              && (srcstr[2] != '?')) {
            /* Skip the slashes */
            srcstr += 2;
            srcremains -= 2;
            wcscpy (retstr, L"\\\\?\\UNC\\");
            retlen -= 8;
            t += 8;
        }
    }

Looks like absolute and unc paths have \\?\ and \\?\UNC appended. This
function is called from all the correct places (apr_file_open, etc.)

I see two solutions to the problem:

a) use absolute paths in subversion
b) change the above code so that
    - relative paths that are longer than MAX_PATH are special cased
    - these paths are converted into absolute paths then have \\?\ prepended

I would be willing to prepare a patch for (b). What do you think?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 28 11:32:47 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.