stat() lstat() not able to read long filename with cyrillic chars?
Corinna Vinschen
corinna-cygwin@cygwin.com
Thu Jan 7 12:48:00 GMT 2016
On Dec 26 22:57, Denis Corbin wrote:
> On 25/12/2015 01:04, Andrey Repin wrote:
> > Greetings, Corinna Vinschen!
> >
> >>> First, I have read the FAQ and this mailing archive :)
> >>>
> [..]
> >
> >> NAME_MAX is 255. On Windows this is the number of UTF-16 chars
> >> unfortunately. On POSIX systems (as on Cygwin) this is the
> >> number of bytes. Long UTF-16 strings in cyrillic take twice as
> >> much UTF-8 chars as it has UTF-16 chars, so NAME_MAX in utf-8
> >> cyrillics translates into a maximum of 127 UTF-16 chars.
>
> Ok, I understand. Thanks for your explanation.
>
> >
> > Aren't POSIX restrictions are a bit different? Namely 128 bytes
> > per path element and 4096 bytes for file name?
>
> Seen the sample file name it seems truncated rather near 256 bytes (~
> 128 UTF-16 chars) than 4096 bytes...
NAME_MAX/_POSIX_NAME_MAX are 255, PATH_MAX/_POSIX_PATH_MAX are 4096.
NAME_MAX defines the maximum length of a path component, PATH_MAX the
maximum length of an entire path. In bytes.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160107/770ef25c/attachment.sig>
More information about the Cygwin
mailing list