Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> - Log files. Append-only mode, enforced. Can't seek back and overwrite. On a crash, the file recovers to some recent good write, with a correct end of file position. It does not tail off into junk.

Linux already semi-supports this with chattr +a, which is filesystem-specific, plus filesystem-specific mount options (e.g. data=journal). unfortunately, implementing the latter is non-trivial to do on a per-file basis.

> - Temp files. Not persistent over restarts. Not backed up. Can be memory-mapped as read/write. On a crash, disappears.

O_TMPFILE exists on Linux, and I don't know of any reason why it couldn't be added to POSIX.

> - Managed files. These are for databases. Async I/O available. May have additional locking functions. Separate completion returns for "accepted data" (caller can reuse write buffer) and "committed data" (safely stored), so the database knows when the data has been safely stored. Can be memory-mapped as read/write. Intended for use by programs which are very aware of the file system semantics. On a crash, "committed data" should be intact but data not yet committed may be lost.

io_uring exists now.

these features are Linux-specific, but my point is that these features do exist now already, there is no need to wish for them.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: