manpagez: man pages & more
info gdbm
Home | html | info | man

File: gdbm.info,  Node: Compatibility,  Next: gdbmtool,  Prev: Error codes,  Up: Top

23 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'!

   Compatibility interface includes only functions required by POSIX
(*note ndbm::) or present in the traditional DBM implementation (*note
dbm::).  Advanced 'GDBM' features, such as crash tolerance, cannot be
used with such databases.

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

* Menu:

* ndbm::  NDBM interface functions.
* dbm::   DBM interface functions.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.