This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: File name too long problem -- maybe fix coming?


On Jan  8 10:47, Gregg Tavares wrote:
> I did take time to look at the code in CVS which is why I posted. The code in CVS has PATH_MAX set to 32760. My point is that's NOT going to work. The 32760 limit in NT is for UTF-16 paths. Those paths have to get converted to and from the current codepage. In any particular code page they will get BIGGER than 32760 characters.  In order for cygwin to actually handle long filenames PATH_MAX has to be set to 131040 because if you get a 32760 UTF-16 path out of FindFileNextExW and you call WideCharToMultiByte the resulting string will be up to 131040 bytes long. 

Standard line breaks in mails would be really helpful, especially for
users with textmode clients.  76 chars/line are usually fine.  It also
allows to avoid full-quotes very conveniently.  Thank you.

I don't think we want to go down this road.  32760 characters as
multibyte path, in the worst case 8K characters, should be really
enough.  Keep in mind how long this path already is.  PATH_MAX on Linux
is 4096.  Another problem is that a PATH_MAX which is bigger than 32K
is totally wrong for all users using single-byte character sets.

The idea of PATH_MAX is mainly to have an upper bound for the *POSIX*
path we can handle, and the hope that the resulting native wide-char
paths also fit in this value, even after evaluating mount points.  I do
not claim or expect that Cygwin will be able to utilize the maximum path
length Windows can handle.

Actually, for a couple of weeks I'm already wondering if we shouldn't
better set PATH_MAX to 32000 or even a smaller value like 16384.  That's
still a darn long path and it's much more safe to handle.

>  The only other change I want
> to make is the CP_ACP parameter which uses the current codepage, It
> will default to CP_ACP but I want to make it user settable so it can
> be set to CP_UTF8 which will solve the other problems I mentioned.

What is the standard ANSI codepage on typical multibyte Windows
installations?  I thought that UTF-8 is the standard ANSI CP for
Japanese or Chinese nowadays?  Also, when you use CYGWIN=codepage:oem,
you can use UTF-8 by changing the console codepage, isn't it?  That's
why I didn't add extra UTF-8 handling so far.

> Making it settable through LC_CTYPE seems like the way to go.

Utilizing LC_CTYPE would be a nice addition at one point.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]