chickadee » lmdb-lolevel » mdb-env-open

mdb-env-open env path flags modeprocedure

Open an environment handle.

If this function fails, (mdb-env-close) must be called to discard the MDB_env handle.

env
An environment handle returned by (mdb-env-create)
path
The directory in which the database files reside. This directory must already exist and be writable.
flags
Special options for this environment. This parameter must be set to 0 or by bitwise OR'ing (using the bitwise-ior procedure) together one or more of the values described in the Constants section with heading 'Environment Flags'. Flags set by (mdb-env-set-flags) are also used.
mode
The UNIX permissions to set on created files and semaphores. This parameter is ignored on Windows.

Some possible error conditions:

(exn lmdb MDB_VERSION_MISMATCH)
the version of the LMDB library doesn't match the version that created the database environment.
(exn lmdb MDB_INVALID)
the environment file headers are corrupted.
(exn lmdb ENOENT)
the directory specified by the path parameter doesn't exist.
(exn lmdb EACCES)
the user didn't have permission to access the environment files.
(exn lmdb EAGAIN)
the environment was locked by another process.