mcDBpack — Pack (defragment) database
#include <memcom.h> int mcDBpack(int handle);
mcDBpack
packs the database
handle
. All inactive and/or deleted sets are
removed, as well as any empty space. Note that
mcDBpack
modifies the file offset (also
referred to as file address) of the datasets. If no empty space is
found mcDBpack
does not modify the
database.
In the current version of MemCom
this function is still in an experimental state, i.e it is not
completely safe: If, for some reason (power off, kill process, etc.)
mcDBpack
cannot terminate, some or all data are
lost. If, for the time being, an absolutely safe operation is
required, copy the entire file to a new file (note that this method
requires up to twice the amount of disk space occupied by the
current database).
mcDBpack
changes the file addresses of
the datasets. Thus,functions which make use of file addresses (like
mcDBputStream
or
mcDBgetStream
) must
then take into account the modified addresses!