Guardian Programmer's Guide

Table Of Contents
Communicating With Disk Files
Guardian Programmer’s Guide 421922-014
5 - 4
Structured Files
Entry-Sequenced Files
Records in an entry-sequenced file are variable length. Writing to the file involves
appending records to the end of the file. Records therefore appear in the file in the
order in which they were written. Once the record is written, its size cannot be
changed.
Figure 5-2 shows the structure of an entry-sequenced file.
The key to an entry-sequenced file is the record address, made up of the block byte
address and the record number within that block. You use the record address to
access a given record. Because you cannot change the length of a record in an entry-
sequenced file, records are usually not updated, unless you do so without changing the
record length.
Entry-sequenced files are useful when records of variable length are anticipated in an
application that stores data chronologically. A transaction logging file, for example,
saves a record of information for each transaction in the order in which the transactions
occurred.
Figure 5-2. Entry-Sequenced File Structure
VST024.VSD