Hardware manual

verNew will create the file foo!4 by remaking the old file foo!2.
Note that this calculation does not verify that all versions
between oldest and newest actually exist.
If only one file matches the lookup name, and its version
number is 0, the file is simply overwritten (like verLatestCreate);
a new version is not created.
If no files of the given name exist, version number 0 of the file is
created (i.e., no version number is explicitly attached to the file
name). The verNewAlways option (below) can be used if
version 1 should be created.
verNewAlways Similar to verNew, but if no earlier version of the file exists,
version 1 is created.
If versions are not enabled, then exact matches are performed on the entire file name. Thus, if the file
"Sys.Errors!2" is present on a disk with versions disabled, the lookup name "Sys.Errors" will not match
this file; the lookup name "Sys.Errors!2" will. The versionControl parameter is still relevant: if no file
matching the lookup name is found, verLatest and verOldest will not create a new file, whereas the other
versionControls will.
The following function creates a disk stream (see above) in conjunction with the Alto directory structure:
OpenFile(lookupname, ksType [ksTypeReadWrite], itemSize [wordItem], versionControl [if
ksType=ksTypeReadOnly then verLatest else if
ksType=ksTypeWriteOnly then verNew else verLatestCreate],
hintFp [0], errRtn [SysErr], zone [sysZone], nil, disk [sysDisk],
CreateStream [CreateDiskStream]) = a disk stream, open on the
specified file, or 0 if the open is unsuccessful for some reason.
This routine parses the lookup name, searching directories as
needed. After applying version control (e.g., making a new
version), it calls CreateStream(filePointer, ksType, itemSize,
Noop, errRtn, zone, nil, disk), and returns the value of that call.
If hintFp is provided, it is assumed to be a file pointer (FP) that
"hints" at the correct identification of the file. Before searching a
directory, OpenFile will try using the hint to open the file,
quickly returning a stream if the hint is valid (though no name or
version checking is done). If the hint fails and lookupname is
non-zero, the name will be parsed and looked up in the normal
fashion. hintFp will be filled in with the correct file pointer.
Note: If you wish to use standard file-lookup procedures, but to
have the FP for the resulting file returned to you, zero the
hintFp vector before calling OpenFile. In this case, the value of
hintFp is not used in the lookup, but is filled in with the results.
OpenFileFromFp(hintFp) = OpenFile(0, 0, 0, 0, hintFp)
DeleteFile(lookupname, versionControl [verOldest], errRtn [SysErr], zone [sysZone], nil, disk
[sysDisk]) = success. Deletes the file on the disk and removes
the corresponding entry from the directory specified in
lookupname. Returns "true" if a file was correctly found and
deleted, otherwise "false."
SetWorkingDir(name, fp, disk [sysDisk]) Sets the "current" directory for further lookups on the
given disk. When the system is booted, the current directory is
set to "<SysDir."
Alto Operating System May 5, 1980 10
For Xerox Internal Use Only -- December 15, 1980