Library Version 12.1.6.0

DbEnv::set_blob_dir()
Prev | Chapter 14. Binary Large Objects | Next

## DbEnv::set_blob_dir()

    #include <db_cxx.h>

    int
    DbEnv::set_blob_dir(const char *dir);

The `DbEnv::set_blob_dir()` method sets the directory where BLOB data is stored. Use this method when the database is opened within an encompassing environment. If an environment is not in use, use Db::set_blob_dir() instead.

By default, if this method is not called then BLOB data is placed in a subdirectory within the DB's environment.

Once this method has been used, you can call DbEnv::get_blob_dir() to identify the current storage location used for BLOB data.

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

This method may not be called after DbEnv::open() is called.

Unless otherwise specified, the `DbEnv::set_blob_dir()` 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

#### dir

Provides the name of the directory where BLOB data is to be stored. If an absolute path is not provided, then the directory identified here is relative to the environment's home directory.

### Errors

The `DbEnv::set_blob_dir()` method may fail and throw a DbException exception, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

#### EINVAL

If the method was called after Db::open() was called; or if an invalid parameter was specified.

### Class

DbEnv

### See Also

BLOBs and Related Methods

Prev | Up | Next
DbEnv::get_blob_threshold() | Home | DbEnv::set_blob_threshold()