Non-Posix File Systems
I&#x27;ve wanted somewhat different file system semantics, but close to the POSIX model:<p>- Unit files. The unit of consistency is the entire file. Files are opened for writing, written, and closed. Then then become openable by other programs. Overwriting a file replaces the file as a unit; other readers see the old file until the writer closes and the reader reopens. This is the default and the case for most files. On a crash, the file reverts to the previous good file, if any. Can be memory-mapped as read only. File replacement can be done now through non-portable renaming gyrations. It should just work.<p>- Log files. Append-only mode, enforced. Can&#x27;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.<p>- Temp files. Not persistent over restarts. Not backed up. Can be memory-mapped as read&#x2F;write. On a crash, disappears.<p>- Managed files. These are for databases. Async I&#x2F;O available. May have additional locking functions. Separate completion returns for &quot;accepted data&quot; (caller can reuse write buffer) and &quot;committed data&quot; (safely stored), so the database knows when the data has been safely stored. Can be memory-mapped as read&#x2F;write.  Intended for use by programs which are very aware of the file system semantics. On a crash, &quot;committed data&quot; should be intact but data not yet committed may be lost.