Procedure 9 |
Read Spectrum |
REQUEST
If the access capability is valid and the spectrum
defined by pathname exists then returns
count items of data from the spectrum. |
The arrays base and range define a region of counts within the spectrum to be returned and the counts may then be considered to form a sequence of data items of size given by the type of the spectrum array. Counts are returned starting at offset data items into the defined region. The first data item is at offset zero.
The data returned is scaled such that the region defined by base and range is returned in an array defined by size and arraytype.
RESPONSE - success The data is returned in the array data. |
The least significant bit of flag is used by the server
as a data format bit
to indicate the format of the data returned.
The remaining bits of flag will normally be set to zero but will be set to
one if truncation/overflow occurred while
scaling the data in order to return it within the array
requested and/or in the type requested.
data format bit |
RESPONSE - failure procedure status which is non zero indicates the cause of the failure. |
procedure status |
XDR Specification
procedure ReadSpectrum (cap, path, number, offset, count, bse, rng, s, type) returns(reply) capability cap; pathname path; unsigned number; unsigned offset; unsigned count; base bse; range rng; size s; arraytype type; union switch (stat status) { OK: unsigned flag; string data <>; 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
server to the client as an opaque data stream for reasons of efficiency and thus the
format of the data must be returned by the server to the client.
In the case of disc based spectrum which may exist in either format for a given server
the server can use the magic number in the spectrum header (which is available to
it but not the client) together with knowledge of its processor type to determine the
endian format of the spectrum.
All other information based between the server and client (including the
data format bit in the flag field)
will be handled by the XDR
encodeing and hence will not appear dependent on processor architecture.
See also corresponding handling in the Write Spectrum
and Create Spectrum procedures.