[Back to Interface] [Prev]

VSwrite/vsfwrt/vsfwrtc/vsfwrit

int32 VSwrite(int32 vdata_id, uint8 *databuf, int32 n_records, int32 interlace_mode)

vdata_id IN:

Vdata identifier returned by VSattach

databuf IN:

Buffer of records to be written to the vdata

n_records IN:

Number of records to be written

interlace_mode IN:

Interlace mode of the buffer in memory

Purpose

Writes data to a vdata.

Return value

Returns the total number of records written if successful and FAIL (or -1) otherwise.

Description

VSwrite writes the data stored in the buffer databuf into the vdata identified by the parameter vdata_id. The parameter n_records specifies the number of records to be written. The parameter interlace_mode defines the interlace mode of the vdata fields stored in the buffer databuf.

Valid values for interlace_mode are FULL_INTERLACE (or 0) and NO_INTERLACE (or 1). Selecting FULL_INTERLACE fills databuf by record and is recommended for speed and efficiency. Specifying NO_INTERLACE causes databuf to be filled by field, i.e., all values of a field in all records must be written before moving to the next field. Thus, all data must be available before writing. If the data is to be written to the vdata with an interlace mode different from that of the buffer, VSsetinterlace must be called prior to VSwrite. Note that the default interlace mode of a vdata is FULL_INTERLACE.

It is assumed that the data in databuf is organized as specified by the parameter interlace_mode. The number and order of the fields organized in the buffer must correspond with the number and order of the fields specified in the call to VSsetfields, which finalizes the vdata fields definition. Since VSwrite writes the data in databuf contiguously to the vdata, VSfpack must be used to remove any "padding", or non-data spaces, used for vdata field alignment. This process is called packing. Refer to the discussion of VSfpack in the HDF User's Guide for more information.

Before writing data to a newly-created vdata, VSdefine and VSsetfields must be called to define the fields to be written.

Note that there are three FORTRAN-77 versions of this routine: vsfwrt is for buffered numeric data, vsfwrtc is for buffered character data and vsfwrit is for generic packed data.

FORTRAN

integer function vsfwrt(vdata_id, databuf, n_records, interlace_mode)

integer vdata_id, n_records, interlace_mode

<valid numeric data type> databuf(*)

integer function vsfwrtc(vdata_id, databuf, n_records, interlace_mode)

integer vdata_id, n_records, interlace_mode

character*(*) databuf

integer function vsfwrit(vdata_id, databuf, n_records, interlace_mode)

integer vdata_id, n_records, interlace_mode

character*(*) databuf



[Back to Interface] [Prev]

hdfhelp@ncsa.uiuc.edu
HDF Reference Manual - 07/29/98, NCSA HDF Development Group.