Procedure 10 |
Write Spectrum |
REQUEST
If the access capability is valid and the spectrum
defined by pathname exists then the supplied data
is written to the spectrum. |
The arrays base and range define a region of counts within the spectrum to be written and the counts may then be considered to form a sequence of data items of size determined by arraytype. count counts are written starting at offset data items into the defined region. The first data item is at offset zero. Type conversion takes place if arraytype differs from the type of the spectrum array being written.
The least significant 8 bits of arraytype defines the format of the data items as defined in EDOC061. The next bit (bit 8 - where bit 0 is the least significant bit and bit 31 is the most significant bit) of arraytype is used as a data format bit to indicate the format of the data.
data format bit |
RESPONSE - success
|
flag will normally be set to zero but will be set to -1 (all 1 bits) if truncation/overflow occurred while converting the data between the type supplied and the type defined for the data array.
RESPONSE - failure procedure status which is non zero indicates the cause of the failure. |
procedure status |
XDR Specification
procedure WriteSpectrum (cap, path, number, offset, count, bse, rng, type, data) returns(reply) capability cap; pathname path; unsigned number; unsigned offset; unsigned count; base bse; range rng; arraytype type; string data <>; union switch (stat status) { OK: unsigned flag; default: struct {} } reply;
Implementation
Spectra data may exist with the data in either big endian format (that is
as used by SunMicrosystems Sparc and Motorola processors) or in little endian format
(as used by Intel processors of the x86 family and Digital). Data is passed from the
client to the server as an opaque data stream for reasons of efficiency and thus the
format of the data must be supplied by the client to the server.
The server will convert the supplied data to the format implied by the existing spectrum header
before writing to the spectrum.
All other information based between the server and client (including the
data format bit in the arraytype field)
will be handled by the XDR
encodeing and hence will not appear dependent on processor architecture.
See also corresponding handling in the Read Spectrum
and Create Spectrum procedures.