X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:mime-version:to:subject:content-type
	:content-transfer-encoding:message-id; q=dns; s=default; b=rs9E6
	mpuKEqOcNOYb5anZyNzIymvZbrbmsUdwuqRgmG299xRr2hhmfaxJYzrgVOfQpfeJ
	pzoKX5HD2fQ9scfYF5YNQjQfa+IXREcd/lV8MYtvf0iUbctFb2czQEL/Nw2P80mW
	7ZbCEj0obicTsBHs5mxixUSFAQJPsM2dvEvgn0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:mime-version:to:subject:content-type
	:content-transfer-encoding:message-id; s=default; bh=oXJWSCbvZVK
	kJ2F2F0Wi3W5M8Rs=; b=RLlZJwB52xFjyuC9p3tLyJA+XwhuEi/DAUGIWrscFzp
	4N51XEdn6PcFVdhJA5nwN6KgGiN6Bc7PSOcMVNa01IuYk+DMaYCDTOg7ww7SLpW3
	k27czvdSIYcIxT93feXTm00+yNRHFx1gMbgY+vsTJZbWsU50pqWbnIeJajb76lbo
	=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: =?ISO-8859-1?Q?Yes, score=6.8 required=5.0 tests=AWL,BAYES_50,BODY_8BITS,FREEMAIL_FROM,GARBLED_BODY,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=8:=d0=b0, 8:=d0=b2, Latin, 8:=d0=b1?=
X-HELO: edrusb.is-a-geek.org
Date: Wed, 23 Dec 2015 20:44:40 +0100
From: Denis Corbin <dar.linux@free.fr>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130119 Icedove/10.0.12
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: stat() lstat() not able to read long filename with cyrillic chars?
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-Id: <20151223194440.5B2A98CFEA@edrusb.is-a-geek.org>
X-IsSubscribed: yes
Note-from-DJ: This may be spam

Hi,

First, I have read the FAQ and this mailing archive :)

Here is the problem I meet:

In a directory are placed three files using windows 8's explorer:
- a short Cyrillic filename "абваб.txt"
- a long Cyrillic filename
"абвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабвабваб.txt"
- a long Latin filename
"ababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababa.txt"


From a C program compiled under Cygwin, I can obtain the corresponding
filename strings using readdir_r()...

"\320\260\320\261\320\262\320\260\320\261.txt"
"\320\260\320\261\320\262\320\260\320\261\320\262\320\260\320\261 [snipped]"
"abababababaababababa [snipped]"

... but passing these strings in turn to lstat() or stat() returns 0 as
expected for all except for the long Cyrillic filename. For for this
string a get a negative value from lstat() and stat() and errno is set
to ENOENT (while the entry is still present).

using "ls" instead of my own program gives something similar: the long
Cyrillic filename is listed but no permission, username, groupname or
data are displayed, these are replaced by question marks.

Is there something special to do and that I missed in order to read long
Cyrillic filenames from a C program under Cygwin?

Thanks for any help,

Regards,
Denis.

--
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

