mcDBputStream — Write to stream
#include <memcom.h> int mcDBputStream(int handle, char* type, mcOff address, mcSize size, void* buffer);
mcDBputStream
writes a contiguous array
of data from the user area to a database starting at a given byte
offset. If the start address plus the number of bytes specified
exceeds the current file size, the size of the file is automatically
increased to accommodate for the additional bytes. Any gaps are
padded with zero bytes. Upon successful completion of the operation,
the status value 0 is returned.
Note | |
---|---|
|
handle
Database handle (input).
type
Dataset type (input). Must be one of
K
(char), I
(mcInt32),
J
(mcInt64), E
(mcFloat32), F
(mcFloat64).
address
Byte address on database where the array starts
(input). The byte address must be greater or equal to 0. To
append data at the end of the file, call the mcDBinqFileAtt
function and extract naddr
, which is the
last free byte address of the file.
size
Number of elements of buffer
to be
written (input).
buffer
Buffer containing data to be transferred (input). The
data must correspond to the dataset type specified by the
type
parameter.