#include <db.h> int DBC->db_stream(DBC *dbc, DB_STREAM **dbs, u_int32_t flags);
The DBcursor->db_stream()
method points to a
key/value pair where the data item is an external file.
Use the flags parameter
to indicate whether the stream is to be opened for reading, or for
reading and writing.
Once the stream is opened, you read it using DB_STREAM->read() , and you write to it using DB_STREAM->write() .
Close this stream using DB_STREAM->close() .
If the data item is not an external file, this method returns an error.
Unless otherwise specified, the
DBcursor->db_stream()
method returns a non-zero error value on failure and 0 on success.
The flags parameter must be set by bitwise inclusively OR'ing together one or more of the following values:
Indicates that the stream is to be opened for read-only access.
Indicates that the stream is to be opened for read write access. The stream is sync'd to disc when the stream is closed.
Indicates that the stream is to be opened for read and write access. The stream is sync'd to disc after each write, instead of when the stream is closed.
The DBcursor->db_stream()
method may fail and return one of the following non-zero errors: