{
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-17",
  "slug": "o-tmpfile",
  "term": "O_TMPFILE",
  "aliases": [
    "Unnamed temporary file"
  ],
  "definition": "O_TMPFILE is a Linux open flag that creates a regular file without a directory entry in a specified directory's filesystem.",
  "note": "Use a writable access mode and an explicit permission mode. Adding O_EXCL prevents later linking, rather than selecting no-overwrite publication. Support depends on the filesystem. [open]\n\nAn ordinary file unlinked while open is not equivalent. Its descriptor can retain readable data, but Linux rejects relinking it after its last name is removed. O_TMPFILE without O_EXCL is a specific exception to the zero-link restriction, not a general undelete mechanism. [link]",
  "related": [
    "hard-link",
    "inode",
    "directory-fsync",
    "rename-noreplace"
  ],
  "citations": [
    {
      "id": "open",
      "title": "Linux man-pages: open(2), O_TMPFILE",
      "url": "https://man7.org/linux/man-pages/man2/open.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "link",
      "title": "Linux man-pages: link(2), zero-link exception and ENOENT",
      "url": "https://man7.org/linux/man-pages/man2/link.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "observation",
      "title": "Hesela: unnamed-file publication observation",
      "url": "https://hesela.com/analyses/tmpfile-publication-rename-contracts/#observation",
      "accessed": "2026-10-17"
    }
  ],
  "provenance": [
    "The local ext4 probe measured zero links before O_TMPFILE publication, preserved inode identity after publication, and rejected relinking an ordinary unlinked file; no power-loss recovery was tested. [observation]"
  ]
}
