mdb_env_copy2 function
@brief Copy an LMDB environment to the specified path, with options.
This function may be used to make a backup of an existing environment.
No lockfile is created, since it gets recreated at need.
@note This call can trigger significant file size growth if run in
parallel with write transactions, because it employs a read-only
transaction. See long-lived transactions under @ref caveats_sec.
@paramin
env An environment handle returned by #mdb_env_create(). It
must have already been opened successfully.
@paramin
path The directory in which the copy will reside. This
directory must already exist and be writable but must otherwise be
empty.
@paramin
flags Special options for this operation. This parameter
must be set to 0 or by bitwise OR'ing together one or more of the
values described here.
- #MDB_CP_COMPACT - Perform compaction while copying: omit free pages and sequentially renumber all pages in output. This option consumes more CPU and runs more slowly than the default. Currently it fails if the environment has suffered a page leak.
Implementation
@ffi.FfiNative<
ffi.Int Function(ffi.Pointer<MDB_env>, ffi.Pointer<ffi.Char>,
ffi.UnsignedInt)>('mdb_env_copy2')
external int mdb_env_copy2(
ffi.Pointer<MDB_env> env,
ffi.Pointer<ffi.Char> path,
int flags,
);