Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (R)
Guardian Procedure Calls Reference Manual—522629-013
13-10
READ[X] Procedures
Unstructured files are transparently blocked. The BUFFERSIZE file attribute
value, if not set by the user, defaults to 4096 bytes. The BUFFERSIZE
attribute value (which is set by specifying SETMODE function 93) does not
constrain the allowable
read-count in any way. However, there is a
performance penalty if the READ[X] does not start on a BUFFERSIZE
boundary and does not have a
read-count that is an integral multiple of the
BUFFERSIZE. The DP2 disk process executes your requested I/O in (possibly
multiple) units of BUFFERSIZE blocks starting on a block boundary.
•
of count-read for unstructured READ[X]s
After a successful call to READ[X] for an unstructured file, the value returned in
count-read is determined by:
count-read := $MIN(read-count &
eof-pointer - next-record pointer)
•
pointers after READ[X]
After a successful READ[X] to an unstructured file, the file pointers are:
CCG = 1 if the next-record pointer = EOF pointer; otherwise CCG = 0
current-record pointer = old next-record pointer
next-record pointer = old next-record pointer +
count-read
Errors for READX Only
In addition to the errors currently returned from READ, error 22 is returned from
READX when:
•
The address of a parameter refers to the selectable segment area but no
selectable segment is in use at the time of the call.
•
The address of a parameter is extended, but it is an absolute address and the
caller is not privileged.
Example
CALL READ ( FILE^NUM , IN^BUFFER , 72 , NUM^XFERRED );
! The READ permits up to 72 bytes to be read into IN^BUFFER,
! and the count actually read returns into NUM^XFERRED.
Related Programming Manuals
For programming information about the READ file-system procedure, refer to the
Guardian Programmer’s Guide, the Enscribe Programmer’s Guide, and the data
communication manuals.