Hardware manual

The standard operations on streams are (S is the stream; "error" means that Errors(S, ec) is executed,
where ec is an error code):
Gets(S) returns the next item. Some streams give an error if Endofs(S) is
true before the call, and others just wait for the next item.
Puts(S, I) writes I into the stream as the next item; error if the stream is
read-only, if there is no more space or if there is some hardware
problem.
Resets(S) restores the stream to some initial state, generally as close as
possible to the state it is in just after it is created.
Putbacks(S, I) modifies S so that the next Gets(S) will return I and leave S in
the state it was in before the Putbacks. Error if there is already a
putback in force on S. (No streams provided by the operating
system implement a Putbacks operation.)
Endofs(S) true if there are no more items to be gotten from S. Not defined
for output streams.
Closes(S) destroys S in an orderly way, and frees the space allocated for it.
Note that this has nothing to do with deleting a disk file.
Stateofs(S) returns a word of state information which is dependent on the
type of stream.
Errors(S, ec) reports the occurrence of an error with error code ec on the
stream. When a system stream is created, Errors is initialized to
SysErr (see section 3.3), but the user can replace it with his own
error routine.
Streams are created differently depending on the device being accessed (disk, display, keyboard, or
memory). The procedures for creating streams are described below.
3.4.1. Disk streams
The system distinguishes four kinds of object which have something to do with storing data on the disk:
Disk Pack: A storage medium that is capable of storing data in various
pages. Most operating system functions default the choice of
disk to "sysDisk", a structure which describes drive 0 of a Diablo
model 31 cartridge.
Disk file: A vector of bytes of data held on some disk, organized into
pages
for some purposes. A file exists only on the disk (except that
parts of it may be in memory if an output stream is associated
with it) and is named by an 80-bit entity called a
file pointer
(FP).
File directory: A disk file which contains a list of pairs <string name, FP>.
Documentation on the format of the file can be found with the
BFS package documentation contained in an appendix to this
manual.
Disk stream: Used by a program to transfer information to or from a disk file.
A stream exists only in memory and is named by a pointer to a
data structure.
Alto Operating System May 5, 1980 5
For Xerox Internal Use Only -- December 15, 1980