Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    Read man readdir getdents. Read man -k inode. The d_type field in the inode holds the info. Commented Oct 21, 2020 at 0:22
  • ls "lists block and char devices [...] and other things that are not stored on disk." Yes, but the directory entries are stored in the same place on the disk as the entries for disk files. (With the exception of virtual file systems like /proc.) You can think of a directory as a file with records of (name, inode number) pairs that each map a name to an inode. Commented Oct 22, 2020 at 3:17