1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

dir.h: direct::d_type

* dir.c (glob_helper): use d_type to reduce lstat system calls.
* win32/dir.h (struct direct): add d_type instead of d_isdir and
  d_isrep.  SYMLINKD is unreliable, since the target can be
  replaced after a link was created.
* win32/win32.c (readdir_internal): set d_type.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-03-14 03:23:56 +00:00
parent b48ef1382f
commit 00f7db376c
4 changed files with 25 additions and 6 deletions

View file

@ -8,6 +8,11 @@
# endif
#endif
#define DT_UNKNOWN 0
#define DT_DIR (S_IFDIR>>12)
#define DT_REG (S_IFREG>>12)
#define DT_LNK 10
struct direct
{
long d_namlen;
@ -15,8 +20,7 @@ struct direct
char *d_name;
char *d_altname; /* short name */
short d_altlen;
char d_isdir; /* directory */
char d_isrep; /* reparse point */
uint8_t d_type;
};
typedef struct {
WCHAR *start;