Library Version 18.1.40

DbStream::close()
Prev | Chapter 14. External Files | Next

## DbStream::close()

    #include <db_cxx.h>

    int
    DbStream::close(u_int32_t flags);

The `DbStream::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 `DbStream::close()` 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

#### flags

The flags parameter must be set to 0.

### Errors

The `DbStream::close()` 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

An invalid flag value or parameter was specified.

### Class

DbStream

### See Also

External Files and Related Methods

Prev | Up | Next
Dbc::db_stream() | Home | DbStream::read()