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

File: gdbm.info,  Node: Reorganization,  Next: Sync,  Prev: Sequential,  Up: Top

10 Database reorganization
**************************

The following function should be used very seldom.

 -- gdbm interface: int gdbm_reorganize (GDBM_FILE DBF)
     Reorganizes the database.

     The parameter is:

     DBF
          The pointer returned by 'gdbm_open'.

   If you have had a lot of deletions and would like to shrink the space
used by the 'GDBM' file, this function will reorganize the database.
This results, in particular, in shortening the length of a 'GDBM' file
by removing the space occupied by deleted records.

   This reorganization requires creating a new file and inserting all
the elements in the old file DBF into the new file.  The new file is
then renamed to the same name as the old file and DBF is updated to
contain all the correct information about the new file.  If an error is
detected, the return value is negative.  The value zero is returned
after a successful reorganization.

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