RD.RAN/WR.RAN - ***DELETED*** use READ/WRITE.

Usage:

rd.ran( filevec, buffer [, sector [, nwds] ] );
wr.ran( filevec, buffer [, sector [, nwds] ] );

Where:

filevec
is the "ret" vector returned by ACC.FIL. In batch, the first word will contain the BCD filecode, and in TSS the first two words will contain the aftname. The status return and file descriptor words are used by RD.RAN and WR.RAN.
buffer
is a buffer into which RD.RAN places the data it reads, and from which WR.RAN takes the data it writes. "buffer" must be big enough to hold "nwds".
sector
is the starting sector address in the file which is being read or written. A sector is 64 words long and the first sector of the file has a sector address of zero. If "sector" is not specified, the default is zero.
nwds
is the number of words to read or write. When writing, if "nwds" is not a multiple of 64, the hardware writes zeroes onto the remaining fraction of a sector. If "nwds" is not specified, the default is 320 words for both reading and writing. "nwds" must lie between 1 and 4096 inclusive.

Description:

RD.RAN and WR.RAN are used to perform binary I/O on random files which have been opened by a call to ACC.FIL.

In WR.RAN, if the write gets an eof status, it will attempt to grow the file by the amount needed to hold the data. If the grow succeeds, the write is reissued. If the grow fails, WR.RAN will not make a second attempt at growing the file.

In TSS, an eof status will be faked if an attempt is made to read from a null file.

It is recommended that you use the routines READ and WRITE instead of RD.RAN and WR.RAN. If you feel you must use RD.RAN and WR.RAN, remember that they only work on random files.

See Also:

expl b lib read
for the recommended functions.
expl b lib acc.fil
for the format of "filevec".
expl b lib .grow
for details on the file growth algorithm.

Copyright © 1996, Thinkage Ltd.