o-tmpfile · shipping · also Unnamed temporary file

O_TMPFILE

O_TMPFILE is a Linux open flag that creates a regular file without a directory entry in a specified directory's filesystem.

Related Observatory article: O_TMPFILE on hesela.com

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. [1]

An 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. [2]

Relations

related
hard-link, inode, directory-fsync, rename-noreplace

Citations

  1. Linux man-pages: open(2), O_TMPFILE (accessed 2026-10-17)
  2. Hesela: unnamed-file publication observation (accessed 2026-10-17)
Sources & caveats

JSON: /data/terms/o-tmpfile.json