Library Version 12.1.6.2

DB_STREAM->close()
Prev | Chapter 13. External Files | Next

## DB_STREAM->close()

    #include <db.h>

    int
    DB_STREAM->close(DB_STREAM *dbs, u_int32_t flags);

The `DB_STREAM->close()` method flushes any unwritten data to disk, frees allocated resources, and closes the underlying file which contains the external file. You open an external file stream using DBC->db_stream().

Once this method is called, the stream can not be used again even if this method returns an error.

Unless otherwise specified, the `DB_STREAM->close()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### flags

The flags parameter must be set to 0.

### Errors

The `DB_STREAM->close()` method may fail and return one of the following non-zero errors:

#### EINVAL

An invalid flag value or parameter was specified.

### Class

DB_STREAM

### See Also

External Files and Related Methods

Prev | Up | Next
DBC->db_stream() | Home | DB_STREAM->read()