This is the mail archive of the
cygwin
mailing list for the Cygwin project.
stat() lstat() not able to read long filename with cyrillic chars?
- From: Denis Corbin <dar dot linux at free dot fr>
- To: cygwin at cygwin dot com
- Date: Wed, 23 Dec 2015 20:44:40 +0100
- Subject: stat() lstat() not able to read long filename with cyrillic chars?
- Authentication-results: sourceware.org; auth=none
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