Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2185 _wdirent.d_type is not set propertly

WSL
unread
nobody
None
Bug
none
Feature_in_WSL_4.0
True
2014-08-30
2014-02-21
Samuel Debionne
No

From the release notes : Mingwrt "redefines the structure for dirent and _wdirent to include d_type and be copesetic to Microsoft attributes."

Under Windows 7 (NTFS filesystem) d_type is not set propertly.

The fix is simple :

@@src/libcrt/tchar/dirent.c:130
-#define DT_IGNORED (_A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_ARCH)
+#define DT_IGNORED (_A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_ARCH | _A_VOLID)

A definition of :

#define _DIRENT_HAVE_D_TYPE

would also be welcomed

Discussion

  • Keith Marshall
    Keith Marshall
    2014-08-30

    Maybe. Thanks for pointing it out. However, you really shouldn't rely on dirent.d_type or _wdirent.d_type to give you meaningful info anyway -- especially in the absence of _DIRENT_HAVE_D_TYPE; POSIX doesn't require it, nor even refer to it in any way.