End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
GDBM#sync
gdbm.sync → gdbm
ext/gdbm/gdbm.c
View on GitHub ↗
static VALUE
fgdbm_sync(VALUE obj)
{
struct dbmdata *dbmp;
GDBM_FILE dbm;
rb_gdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
gdbm_sync(dbm);
return obj;
}
Unless the gdbm object has been opened with the SYNC flag, it is not guaranteed that database modification operations are immediately applied to the database file. This method ensures that all recent modifications to the database are written to the file. Blocks until all writing operations to the disk have been finished.