GDBM manual (split by section):   Section:   Chapter:FastBack: Error codes   Up: Top   FastForward: gdbmtool   Contents: Table of ContentsIndex: Index

20 Compatibility with standard dbm and ndbm.

Gdbm includes a compatibility layer, which provides traditional ‘ndbm’ and older ‘dbm’ functions. The layer is compiled and installed if the --enable-libgdbm-compat option is used when configuring the package.

The compatibility layer consists of two header files: ndbm.h and dbm.h and the libgdbm_compat library.

Older programs using ndbm or dbm interfaces can use libgdbm_compat without any changes. To link a program with the compatibility library, add the following two options to the cc invocation: -lgdbm -lgdbm_compat. The -L option may also be required, depending on where gdbm is installed, e.g.:

cc ... -lgdbm -lgdbm_compat

Databases created and manipulated by the compatibility interfaces consist of two different files: file.dir and file.pag. This is required by the POSIX specification and corresponds to the traditional usage. Note, however, that despite the similarity of the naming convention, actual data stored in these files has not the same format as in the databases created by other dbm or ndbm libraries. In other words, you cannot access a standard UNIX dbm file with GNU dbm!

GNU dbm files are not sparse. You can copy them with the usual cp command and they will not expand in the copying process.

GDBM manual (split by section):   Section:   Chapter:FastBack: Error codes   Up: Top   FastForward: gdbmtool   Contents: Table of ContentsIndex: Index