MemCom Reference Manual > MemCom C API Manual Pages > Database Manager Functions > mcDBsaveFile

Name

mcDBsaveFile, mcDBsaveFileNoSync — Save current database

Synopsis

#include <memcom.h>

int mcDBsaveFile(int handle);
int mcDBsaveFileNoSync(int handle);

Description

mcDBsaveFile saves the context of the current file handle to disk, performing a close operation followed by re-open. If completed successfully, the function returns 0. Otherwise, a negative value indicating the MemCom error number is returned. mcDBsaveFileNoSync performs the same operations but does not invoke the kernel's fsync(2) call for flushing (or synchronizing) file data to disk. Depending on the type of file system and the file system settings, omitting fsync(2) improves performance, but database integrity might be impaired if the machine crashes 1-2 minutes after mcDBsaveFileNoSync has been called.

Parameters

handle

Database handle of file to be saved (input).

See also

mcDBopenFile, mcDBcloseFile