libjio is a userspace library to do journaled, transaction-oriented I/O.
It provides a very simple API to commit and rollback transactions, and on top of that a UNIX-alike set of functions to perform most regular operations (ie. open(), read(), write()) in a non-intrusive threadsafe and atomic way, with safe and fast crash recovery.
This allows the library to guarantee file integrity even after unexpected crashes, never leaving your files in an inconsistent state. On the disk, the file you work on is exactly like a regular one, but a special directory is created to store in-flight transactions.
It’s written in plain C, in less than 1500 lines of code, and has no dependencies on external libraries. It’s based on the traditional POSIX API and follows the Single UNIX Specification, so it should be portable to all major UNIX variants without problems; however it’s developed under Linux, so please let me know if you try it somewhere else.
It also has Python bindings.
Library
Alberto-Bertogli
transaction
posix
I/O
C
filesystem
python
linux
libjio