public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* stat() lstat() not able to read long filename with cyrillic chars?
@ 2015-12-23 19:44 Denis Corbin
  2015-12-24 19:24 ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Corbin @ 2015-12-23 19:44 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-07 12:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-23 19:44 stat() lstat() not able to read long filename with cyrillic chars? 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 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).