Library Version 12.1.6.0

DB_MPOOLFILE->set_flags()
Prev | Chapter 8. The DB_MPOOLFILE Handle | Next

## DB_MPOOLFILE->set_flags()

    #include <db.h>

    int
    DB_MPOOLFILE->set_flags(DB_MPOOLFILE *mpf, u_int32_t flags, int onoff)

Configure a file in the cache.

To set the flags for a particular database, call the `DB_MPOOLFILE->set_flags()` method using the DB_MPOOLFILE handle stored in the mpf field of the DB handle.

The `DB_MPOOLFILE->set_flags()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### flags

The flags must be set to one of the following values:

- `DB_MPOOL_NOFILE`

  If set, no backing temporary file will be opened for the specified in-memory database, even if it expands to fill the entire cache. Attempts to create new database pages after the cache has been filled will fail.

  The `DB_MPOOL_NOFILE` flag configures a file in the cache, not only operations performed using the specified DB_MPOOLFILE handle.

  The `DB_MPOOL_NOFILE` flag may be used to configure Berkeley DB at any time during the life of the application.

- `DB_MPOOL_UNLINK`

  If set, remove the file when the last reference to it is closed.

  The `DB_MPOOL_ULINK` flag configures a file in the cache, not only operations performed using the specified DB_MPOOLFILE handle.

  The `DB_MPOOL_ULINK` flag may be used to configure Berkeley DB at any time during the life of the application.

#### onoff

If onoff is zero, the specified flags are cleared; otherwise they are set.

### Class

DB_ENV, DB_MPOOLFILE

### See Also

Memory Pools and Related Methods

Prev | Up | Next
DB_MPOOLFILE->set_fileid() | Home | DB_MPOOLFILE->set_ftype()