{
  "slug": "o-path",
  "term": "O_PATH",
  "aliases": [
    "O_PATH descriptor"
  ],
  "definition": "O_PATH is a Linux open flag that returns a filesystem-object reference without opening the object for ordinary data access.",
  "note": "The descriptor supports fstat(), duplication and, for a directory, relative openat() calls. It cannot supply file data or synchronize storage: read(), write(), mmap() and fsync() fail with EBADF, including fsync() on a directory reference. Acquiring it requires path-prefix search permission, not permissions on the final object; subsequent operations may perform their own checks. [linux-open-2]\n\nWith O_NOFOLLOW, the descriptor can hold the final symlink itself for operations such as readlinkat() with an empty pathname. It does not hold that link's referent. [linux-symlink-7]\n\nA held reference remains associated with its object through pathname replacement. That lifetime guarantee is separate from namespace locking or preserving a version of file contents: another authorized writer can still modify the held file. [linux-path-lookup]",
  "advantages": [
    "Provides a reference for metadata inspection or directory-relative lookup without requesting ordinary data access."
  ],
  "limitations": [
    "Linux-specific; an O_PATH descriptor is not a readable backup stream or a content snapshot.",
    "A directory reference alone does not confine later lookup beneath that directory."
  ],
  "related": [
    "path-resolution",
    "symbolic-link",
    "open-file-description",
    "directory-fsync"
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-04",
  "citations": [
    {
      "id": "linux-open-2",
      "title": "Linux man-pages: open(2), O_PATH operations and permission checks",
      "url": "https://man7.org/linux/man-pages/man2/open.2.html",
      "accessed": "2026-11-04"
    },
    {
      "id": "linux-symlink-7",
      "title": "Linux man-pages: symlink(7), descriptors referring to links",
      "url": "https://man7.org/linux/man-pages/man7/symlink.7.html",
      "accessed": "2026-11-04"
    },
    {
      "id": "linux-path-lookup",
      "title": "Linux v6.12: Pathname lookup, dentry references and locking",
      "url": "https://www.kernel.org/doc/html/v6.12/filesystems/path-lookup.html",
      "accessed": "2026-11-04"
    }
  ],
  "provenance": [
    "API source review. Reference lifetime, data-access permission and content consistency are separate properties; no crash-recovery guarantee is inferred."
  ]
}
