Rawdbfs has additional features for database use: -x causes two additional files ("index" and "stats") to appear in the mounted directory, -l specifies that a record can only be opened for writing by one process at once, and -u cmd specifies a sh(1) command to be run whenever the contents of the database change. The index file is provided as a convenience for database client applications. Once initialised (by writing an integer value to it), subsequent reads return an ever-increasing integer value. Reading the stats file returns counts of database read, write, create and delete operations as a string of four integers.
Dbfs and rawdbfs differ in the way that they store their data. Dbfs stores its records in file in a simple text format: the end of a record is indicated by an empty line. The file is completely rewritten every time a record is written. Storing records containing blank lines will lead to confusion when the database is re-read. Rawdbfs can store arbitrary data, but the format of the data storage is known only to itself. It does not rewrite the whole file on every record change, so can be more suitable for flash-based storage, where it is important to minimise the number of writes.
Note that the record numbers always get their initial numbering from the order of the records in file. You cannot assume that the filename given to a record will remain the same between runs of dbfs.
There is no way to compact a file maintained by dbfs.
|DBFS(4 )||Rev: Tue Mar 31 02:42:39 GMT 2015|