Next: Export and Import, Previous: Database Synchronization, Up: The GNU database manager [Contents][Index]
As of version 1.25, GDBM supports databases in
two formats: standard and extended. The standard format
is used most often. The extended database format is used to
provide additional crash resistance (see Crash Tolerance).
Depending on the value of the flags parameter in a call to
gdbm_open (see GDBM_NUMSYNC), a database can be
created in either format.
The format of an existing database can be changed using the
gdbm_convert function:
Changes the format of the database file dbf. Allowed values for flag are:
0Convert database to the standard format.
GDBM_NUMSYNCConvert database to the extended numsync format (see Numsync Extension).
On success, the function returns 0. In this case, it should be
followed by a call to gdbm_sync (see Database Synchronization) or
gdbm_close (see Closing the database) to ensure the changes are written to
the disk.
On error, returns -1 and sets the gdbm_errno variable
(see gdbm_errno).
If the database is already in the requested format, the function returns success (0) without doing anything.