manpagez: man pages & more
info gdbm
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11 Database Synchronization

Unless your database was opened with the ‘GDBM_SYNC’ flag, gdbm does not wait for writes to be flushed to the disk before continuing. This allows for faster writing of databases at the risk of having a corrupted database if the application terminates in an abnormal fashion. The following function allows the programmer to make sure the disk version of the database has been completely updated with all changes to the current time.

gdbm interface: void gdbm_sync (GDBM_FILE dbf)

Synchronizes the changes in dbf with its disk file. The parameter is a pointer returned by gdbm_open.

This function would usually be called after a complete set of changes have been made to the database and before some long waiting time. The gdbm_close function automatically calls the equivalent of gdbm_sync so no call is needed if the database is to be closed immediately after the set of changes have been made.


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