Enscribe Programmer's Guide

5 Unstructured Files
Enscribe Unstructured Files
An Enscribe unstructured file is essentially a byte array on disk that starts at byte address zero and
continues sequentially upward through whatever byte address is identified by the end-of-file (EOF)
pointer. The file system imposes no further structure on such files. How data is grouped into records
and how records are ordered within the file are the responsibility of the application process.
The files created by the EDIT or TEDIT utilities, for example, are unstructured. What structure they
do have is imposed by the utilities themselves, not by the Enscribe software. Such files can be read
by the EDITREAD procedure, by the sequential I/O (SIO) routines, or by EDIT or TEDIT. EDIT and
TEDIT files are identifiable by the file code 101.
Application designers typically use unstructured files for exclusive (nonshared), intermediate storage
of fixed-length data records that are accessed sequentially.
Access to the data in unstructured files is accomplished using a relative byte address (RBA)
maintained by the Enscribe software and the read-count or write-count parameter supplied by the
application process in system procedure calls such as FILE_READ64_, FILE_WRITE64_,
FILE_READUPDATE64_, READ[X], WRITE[X], and READUPDATE[X].
Applicable System Procedures
You use these system procedures to create and access Enscribe unstructured files:
FILE_CREATE_, FILE_CREATELIST_
FILE_OPEN_, FILE_CLOSE_, AWAITIO[X], FILE_AWAITIO64_
FILE_LOCKFILE64_, FILE_LOCKREC64_, FILE_UNLOCKFILE64_,
FILE_UNLOCKREC64_, LOCKFILE, LOCKREC, UNLOCKFILE, UNLOCKREC
FILE_SETPOSITION_, FILE_SAVEPOSITION_, FILE_RESTOREPOSITION_
FILE_READ64_, FILE_READLOCK64_, FILE_READUPDATE64_,
FILE_READUPDATELOCK64_, READ[X], READLOCK[X], READUPDATE[X],
READUPDATELOCK[X]
FILE_WRITE64_, FILE_WRITEUPDATE64_, FILE_WRITEUPDATEUNLOCK64_,
WRITE[X], WRITEUPDATE[X], WRITEUPDATEUNLOCK[X]
FILE_GETINFO_, FILE_GETINFOLIST_, FILE_GETINFOBYNAME_,
FILE_GETINFOLISTBYNAME_
SETMODE, CONTROL, FILE_CONTROL64_
Types_Access
The types of access associated with unstructured files are sequential access, random access, and
appending to the end of a file.
To perform sequential access, you use successive FILE_READ64_, FILE_READLOCK64_,
FILE_WRITE64_, READ[X], READLOCK[X], and WRITE[X] calls to operate upon consecutively higher
blocks of data. To perform random access, you use the FILE_SETPOSITION_ system procedure to
explicitly manipulate the content of the current-record and next-record pointers. You can also use
FILE_SETPOSITION_ to change the content of the next-record pointer so that it points to the EOF
position (for appending records to the end of the file); you do so by specifying the value -1 as the
desired RBA.
60 Unstructured Files