NAME

dyndbmake - create a dynamic database
dyndbdump - dump a dynamic database
dyndbfdump - faster dump of a dynamic database

SYNOPSIS

dyndbmake dbfile tmpfile <input
dyndbdump [-n] <dbfile
dyndbfdump [-n] <dbfile

Desciption

dyndbmake

dyndbmake creates a temporary database file tmpfile, reads a series of encoded records from its standard input and appends them to tmpfile. As soon as it runs out of input it will move tmpfile to dbfile, deleting any former file in that place.

tmpfile is destroyed if it already exists.
dyndbmake
makes sure that tmpfile is safely written to disk before it replaces dbfile in an atomical operation. The directories containing the files must be writable to dyndbmake. Both must also be on the same filesystem.

If the input is in a bad format or if dyndbmake has any trouble writing tmpfile to disk, dyndbmake complains and leaves dbfile alone.

dyndbdump

dyndbdump reads a database from its standard input and prints the database contents, in the format described below, on standard output. If the -n option is used then no final newline will be written.

dyndbdump may be used while other processes add new information to dbfile. It may dump records more than once in that case.

dyndbfdump

dyndbfdump is like dyndbdump, but faster. It must not be used while other processes write to dbfile.

Record format

dyndbmake expects records in the following format:

+klen,dlen:key->data

Note the "plus" character.
klen
is the length of the key, measured in bytes. dlen is the length of the data, again measured in bytes. key is the key, and data is the data. The end of the record is indicated by a newline character.

An extra newline character terminates the data.

Example:

  line1: +1,2:a->ab
  line2: +3,4:abc->abcd
  line3:

dyndbmake allows for many records with the same key, but the reading functions need to support that (my ones only read on record from the database).

dyndbmake, dyndbdump and dyndbfdump do not preserve the order of records.

Author

Uwe Ohse, uwe@ohse.de

See also

dyndb_intro(7), dyndbget(1).

The homepage may be more up-to-date, see http://www.ohse.de/uwe/dyndb.html.