DB_ENV->set_intermediate_dir_mode API Ref

#include <db.h>

int DB_ENV->set_intermediate_dir_mode(DB_ENV *dbenv, const char *mode);

int DB_ENV->get_intermediate_dir_mode(DB_ENV *dbenv, const char **modep);


Description: DB_ENV->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 DB_ENV->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 DB_ENV->set_intermediate_dir_mode method configures operations performed using the specified DB_ENV handle, not all operations performed on the underlying database environment.

The DB_ENV->set_intermediate_dir_mode method may not be called after the DB_ENV->open method is called.

The DB_ENV->set_intermediate_dir_mode method returns a non-zero error value on failure and 0 on success.

Parameters
mode

Errors

The DB_ENV->set_intermediate_dir_mode method may fail and return one of the following non-zero errors:


EINVAL

Description: DB_ENV->get_intermediate_dir_mode

The DB_ENV->get_intermediate_dir_mode method returns the intermediate directory permissions.

The DB_ENV->get_intermediate_dir_mode method may be called at any time during the life of the application.

The DB_ENV->get_intermediate_dir_mode method returns a non-zero error value on failure and 0 on success.

Parameters
modep


Class DB_ENV
See Also Database Environments and Related Methods

APIRef

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