{
  "slug": "directory",
  "term": "Directory",
  "aliases": [
    "filesystem directory"
  ],
  "definition": "A directory is a filesystem object whose entries associate names with files, including other directories.",
  "note": "Names: A directory organizes names, not the contents of every file reached through those names. Linux VFS represents directories with inode objects. Several names can reach the same file through hard links; a name is not a separate data copy. [directory-vfs]\n\nIdentity: The directory, an entry within it and a Linux dentry are different objects. A dentry caches pathname-lookup information in RAM; it is not a stored directory record. The backing filesystem determines how directory information is represented. [directory-vfs]\n\nAccess: POSIX.1-2017 opendir() requires search access through the path prefix and read access to the directory being listed. Linux uses the directory execute permission bit for search. Listing names and resolving a known name are distinct operations; neither alone grants permission to read the target file. [directory-opendir] [directory-path]\n\nObservation: Successive readdir() calls do not promise a point-in-time inventory. POSIX.1-2017 leaves unspecified whether entries added or removed after opendir() or rewinddir() appear in subsequent results. A consistent inventory therefore needs a separately established snapshot or coordination contract. [directory-readdir]",
  "advantages": [],
  "limitations": [
    "A filesystem directory is not the same abstraction as an object-store key prefix.",
    "A completed directory scan does not establish crash persistence or backup completeness."
  ],
  "related": [
    "inode",
    "dentry",
    "path-resolution",
    "directory-enumeration",
    "link-count",
    "setgid-directory",
    "sticky-bit",
    "directory-search-permission"
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-16",
  "citations": [
    {
      "id": "directory-vfs",
      "title": "Linux 6.12: VFS directory, inode and dentry objects",
      "url": "https://docs.kernel.org/6.12/filesystems/vfs.html",
      "accessed": "2026-11-15"
    },
    {
      "id": "directory-opendir",
      "title": "POSIX.1-2017: opendir, search permission and directory read permission",
      "url": "https://man7.org/linux/man-pages/man3/fdopendir.3p.html",
      "accessed": "2026-11-15"
    },
    {
      "id": "directory-path",
      "title": "Linux man-pages: path_resolution(7), search and target access",
      "url": "https://man7.org/linux/man-pages/man7/path_resolution.7.html",
      "accessed": "2026-11-15"
    },
    {
      "id": "directory-readdir",
      "title": "POSIX.1-2017: readdir and concurrent additions or removals",
      "url": "https://man7.org/linux/man-pages/man3/readdir.3p.html",
      "accessed": "2026-11-15"
    }
  ],
  "provenance": [
    "Primary-source synthesis of Linux 6.12 VFS, Linux path-resolution documentation and the explicitly labeled POSIX.1-2017 manual reproduction. No directory, permission or crash experiment was performed.",
    "The consistent-inventory guidance is an engineering inference from the stated API limitation, not an extra POSIX requirement.",
    "Human context: https://hesela.com/analyses/atomic-rename-directory-durability/#directory-foundation"
  ]
}
