DbEnv::set_intermediate_dir_mode API Ref

#include <db_cxx.h>

int DbEnv::set_intermediate_dir_mode(u_int32_t mode);

int DbEnv::get_intermediate_dir_mode(u_int32_t *modep);


Description: DbEnv::set_intermediate_dir_mode

By default, Berkeley DB does not create intermediate directories needed for recovery, that is, if the file /a/b/c/mydatabase is being recovered, and the directory path b/c does not exist, recovery will fail. This default behavior is because Berkeley DB does not know what permissions are appropriate for intermediate directory creation, and creating the directory might result in a security problem.

The DbEnv::set_intermediate_dir_mode method causes Berkeley DB to create any intermediate directories needed during recovery, using the specified permissions.

On UNIX systems or in IEEE/ANSI Std 1003.1 (POSIX) environments, created directories are owned by the process owner; the group ownership of created directories is based on the system and directory defaults, and is not further specified by Berkeley DB.

The database environment's intermediate directory permissions may also be configured using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_intermediate_dir_mode", one or more whitespace characters, and the directory permissions. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The DbEnv::set_intermediate_dir_mode method configures operations performed using the specified DbEnv handle, not all operations performed on the underlying database environment.

The DbEnv::set_intermediate_dir_mode method may not be called after the DbEnv::open method is called.

The DbEnv::set_intermediate_dir_mode method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters
mode

Errors

The DbEnv::set_intermediate_dir_mode method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:


EINVAL

Description: DbEnv::get_intermediate_dir_mode

The DbEnv::get_intermediate_dir_mode method returns the intermediate directory permissions.

The DbEnv::get_intermediate_dir_mode method may be called at any time during the life of the application.

The DbEnv::get_intermediate_dir_mode method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters
modep


Class DbEnv
See Also Database Environments and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.