manpagez: man pages & more
info gdbm
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [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 ... -L/usr/local/lib -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.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on December 2, 2011 using texi2html 5.0.