This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: dirent.d_type is not working on Cygwin symbolic links.
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Sun, 29 Jan 2017 12:15:00 +0100
- Subject: Re: dirent.d_type is not working on Cygwin symbolic links.
- Authentication-results: sourceware.org; auth=none
- References: <b431ce093f2949901c68c3c93fe0693c@xs4all.nl>
waterlan wrote:
The dirent.d_type value for Cygwin symbolic links is 0 (DT_UNKNOWN).
The value is 10 (DT_LNK) for Windows native symbolic links. I think
d_type should be 10 for Cygwin symbolic links too.
Sorry, no.
The actual type should only be returned in dirent.d_type if the info is
available at very low cost. This is not the case for Cygwin symbolic links.
If DT_UNKNOWN is returned, lstat() must be called if type info is required.
Quote from Linux man page readdir(3):
"All applications must properly handle a return of DT_UNKNOWN."
(https://linux.die.net/man/3/readdir)
See also thread starting at:
https://sourceware.org/ml/cygwin-patches/2008-q4/msg00000.html
Regards,
Christian
--
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