From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: stat() lstat() not able to read long filename with cyrillic chars?
Date: Thu, 07 Jan 2016 12:48:00 -0000 [thread overview]
Message-ID: <20160107124756.GB20447@calimero.vinschen.de> (raw)
In-Reply-To: <20151226215732.3196F8B96F@edrusb.is-a-geek.org>
[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2016-01-07 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 19:44 Denis Corbin
2015-12-24 19:24 ` Corinna Vinschen
2015-12-25 0:05 ` Andrey Repin
2015-12-26 21:57 ` Denis Corbin
2016-01-07 12:48 ` Corinna Vinschen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160107124756.GB20447@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).