[haiku-bugs] Re: [Haiku] #10991: readdir (dirent.h) does not have d_type

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Tue, 01 Jul 2014 13:46:18 -0000

#10991: readdir (dirent.h) does not have d_type
----------------------------+----------------------------
   Reporter:  waddlesplash  |      Owner:  nobody
       Type:  enhancement   |     Status:  closed
   Priority:  normal        |  Milestone:  R1
  Component:  System/POSIX  |    Version:  R1/Development
 Resolution:  invalid       |   Keywords:
 Blocked By:                |   Blocking:
Has a Patch:  0             |   Platform:  All
----------------------------+----------------------------

Comment (by pulkomandy):

 The problem is not supporting directories. The problem is this struct is
 something you get by reading only the information in the parent directory.
 Some filesystem have a marker there to know what the filetype is, but
 others do not, and for those, you need to follow the directory entry to
 the target node in order to get the information. And there is already a
 way to do that: it's stat().

 If you implement this, it will make readdir() much slower on these
 filesystems, because instead of reading just the directory, all the files
 contained in it will also need to be stat'ed to get the information. Or we
 could always return DT_UNKNOWN, but that's not useful in any way.

--
Ticket URL: <https://dev.haiku-os.org/ticket/10991#comment:5>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: