This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cant access to files more than 128 utf-8 symbol long names
- From: Mikhail Usenko <mikeus at nm dot ru>
- To: cygwin at cygwin dot com
- Date: Wed, 11 Dec 2013 17:49:22 +0400
- Subject: Re: cant access to files more than 128 utf-8 symbol long names
- Authentication-results: sourceware.org; auth=none
- References: <52A6BFA4 dot 9010101 at spektr-rfs dot ru> <20131210102755 dot GQ2527 at calimero dot vinschen dot de>
On Tue, 10 Dec 2013 11:27:55 +0100
Corinna Vinschen <...> wrote:
> Easier said than done.
>
> Cygwin is using the native NT API
> and, occasionally, the Win32 UNICODE file API, which allows paths of up
> to 32767 chars.
> ...
> How do you represent this in a byte-oriented POSIX system? What do you
> set NAME_MAX to? You can't get it right due to the unfortunate multibyte
> vs. UTF-16 encoding issue.
>
> To cover all UTF-8 chars, NAME_MAX would have to be 1020. But then,
> applications relying on NAME_MAX will be surprised by ENAMETOOLONG
> errors for perfectly valid POSIX filenames.
>
> If you make it 255, applications will be surprised by ENAMETOOLONG
> errors for perfectly valid Windows filenames.
>
Strictly speaking, the NAME_MAX and PATH_MAX POSIX' limits must be 32767*4 bytes, that is ~128K on Windows systems. With such a value no one Cygwin application running on the Windows does not come across the ENAMETOOLONG error because of the nonexistence of the actual filenames with this length (and hence POSIX filenames too). Did I understand rigth?
--
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple