Guardian Programmer's Guide

Table Of Contents
Using the File System
Guardian Programmer’s Guide 421922-014
2 - 21
2 Using the File System
If you now issue the following WRITEX call, 512 bytes are written into the disk file,
starting at the byte addressed by the next-record pointer. The effect on the pointers is
the same as if you had issued a READ call:
WCOUNT := 512;
CALL WRITEX(FILENUM,
SBUFFER,
WCOUNT);
Random access to a disk file is provided by the POSITION procedure. This procedure
sets the current-record pointer and next-record pointer. The following example sets
both these pointers to relative byte 4096:
FILE^POINTERS := 4096D;
CALL POSITION(FILENUM,
FILE^POINTERS);
Note that the procedure requires a double-length integer.
A READX call now reads the data, starting at relative byte 4096:
RCOUNT := 512;
CALL READX(FILENUM,
SBUFFER,
RCOUNT,
NUMXFERRED);
This call transfers 512 bytes from the disk file starting at relative byte 4096 into
SBUFFER. The next-record pointer is increased by 512 bytes so that further
VST011.VSD