* Create the database directory if it doesn't exist.

This commit is contained in:
Eelco Dolstra 2007-05-07 16:59:19 +00:00
parent 30beeb27a9
commit e5da9c8803

View file

@ -142,6 +142,15 @@ Database::~Database()
void openEnv(DbEnv * & env, const string & path, u_int32_t flags)
{
try {
createDirs(path);
} catch (SysError & e) {
if (e.errNo == EPERM || e.errNo == EACCES)
throw DbNoPermission(format("cannot create the Nix database in `%1%'") % path);
else
throw;
}
try {
env->open(path.c_str(),
DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN |