Appendix E: File‑Stack Processing

A file stack is multiple sets of fixed‑length, logical records, stored in a single, physical scratch file. These logical record sets are organized in the file in a last‑in, first‑out (LIFO) stack manner. A file stack enables you to “stack” temporary files, rather than maintaining multiple files individually.

File stacks are maintained by the Toolkit file‑stack subroutines. These routines are used by Toolkit’s list processor, and can be called from your applications as well.

Introduction to file‑stack processing

The file‑stack subroutines

FS_APPEND - Append a record to the current logical file

FS_CLOSE - Close one or more logical files

FS_INIT - Initialize a file‑stack system

FS_OPEN - Add a logical file to the top of the stack

FS_PARAM - Get a logical file’s parameters

FS_QUIT - Terminate a file‑stack system

FS_READ - Read an existing record from a logical file

FS_WRITE - Write a record to a logical file