Library Version 11.2.5.3

DbEnv::set_lg_filemode()
Prev | Chapter 8. The DbLsn Handle | Next

## DbEnv::set_lg_filemode()

    #include <db_cxx.h>

    int
    DbEnv::set_lg_filemode(int lg_filemode);

Set the absolute file mode for created log files. This method is only useful for the rare Berkeley DB application that does not control its umask value.

Normally, if Berkeley DB applications set their umask appropriately, all processes in the application suite will have read permission on the log files created by any process in the application suite. However, if the Berkeley DB application is a library, a process using the library might set its umask to a value preventing other processes in the application suite from reading the log files it creates. In this rare case, the `DbEnv::set_lg_filemode()` method can be used to set the mode of created log files to an absolute value.

The database environment's log file mode 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_lg_filemode", one or more whitespace characters, and the absolute mode of created log files. 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_lg_filemode()` method configures a database environment, not only operations performed using the specified DbEnv handle.

The `DbEnv::set_lg_filemode()` method may be called at any time during the life of the application.

The `DbEnv::set_lg_filemode()` 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

#### lg_filemode

The lg_filemode parameter is the absolute mode of the created log file.

### Class

DbEnv, DbLogc, DbLsn

### See Also

Logging Subsystem and Related Methods

Prev | Up | Next
DbEnv::set_lg_dir() | Home | DbEnv::set_lg_max()