AMFiles.mesa
Last Modified On December 12, 1983 8:42 am By Paul Rovner
DIRECTORY
BasicTime USING [GMT, nullGMT],
FS USING [OpenFile],
Rope USING [ROPE];
AMFiles: CEDAR DEFINITIONS = BEGIN OPEN Rope;
pathPrefixes: LIST OF ROPE; -- the search list for symbol and source files
The list of path name prefixes that are used by the procs below.
Each entry on this list has either the form "/.../" or the form "[...]<...>"
The last entry on this list is always "///"
PrependPathPrefix: PROC[pathPrefix: ROPE]; -- to pathPrefixes
pathPrefixes ← CONS[pathPrefix, pathPrefixes];
pathPrefix must have the form "/.../" or the form "[...]<...>"
FullFileName: PROC
[shortName: ROPE, createTime: BasicTime.GMT ← BasicTime.nullGMT]
RETURNS[fullName: ROPE];
Finds the full path name of a symbol or source file.
Assumes that shortName has an appropriate extension.
Returns shortName if it begins with [, / or <.
First tries FS.FileInfo on shortName, then prepends each element of pathPrefixes and uses FS.FileInfo to find the file.
Returns NIL if no file is found
OpenIt: PROC
Open a symbol or source file for read (using FullFileName and FS.Open)
Returns [NIL, FS.nullOpenFile] if file not found
[shortName: ROPE, createTime: BasicTime.GMT ← BasicTime.nullGMT]
RETURNS[fullName: ROPE, openFile: FS.OpenFile];
END.