Guardian Programmer's Guide

Table Of Contents
Communicating With Disk Files
Guardian Programmer’s Guide 421922-014
5 - 9
Using Unstructured Files
For more information about queue files and how to use them, refer to the Enscribe
Programmers Guide.
Using Unstructured Files
You can access unstructured files using system procedures such as FILE_OPEN_,
READ[X], READUPDATE[X], WRITE[X], WRITEUPDATE[X], and so on. Unstructured
files are suitable for sequential I/O; successive calls to the READX procedure, for
example, read successive records from the file. Positioning is done by the file system,
which advances the current-record and next-record pointers as records are read.
Much of the method for working with unstructured files has already been discussed in
Section 2, Using the File System. This subsection emphasizes how to create
unstructured files.
The IOEdit subset of procedures, provides additional functions for accessing
unstructured EDIT files. Refer to Section 14, Using the IOEdit Procedures, for details.
As an aid to sequential-file access, the procedure library contains another subset of
procedures specifically for sequential I/O. These procedures are known as the
sequential input/output (SIO) procedures and are described in Section 15, Using the
Sequential Input/Output Procedures.
For an example of accessing an unstructured file using READX, WRITEX, and
POSITION procedure calls, refer to the log-file program given at the end of Section 2,
Using the File System.
Creating Unstructured Files
You can create an unstructured file interactively using the FUP CREATE command or
programmatically by issuing a call to the FILE_CREATE[LIST]_ procedure. In either
case, you need to supply the following information:
The file type for an unstructured file. Unstructured is the default file type.
The size of the buffer used to transfer data between the disk and the disk process
for an unstructured file. The buffer size can be 512, 1024, 2048, or 4096 bytes.
The default block size is 4096 bytes.
You can improve the efficiency of the disk cache management scheme by setting
the buffer size to the same size as each data transfer. See the discussion on
transfer size in the Enscribe Programmer’s Guide for details.