AMFiles.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Rovner, December 12, 1983 8:42 am
Russ Atkinson (RRA) February 7, 1985 10:30:11 am PST
DIRECTORY
BasicTime USING [GMT, nullGMT],
FS USING [OpenFile],
Rope USING [ROPE];
AMFiles: CEDAR DEFINITIONS = BEGIN OPEN BasicTime, FS, Rope;
pathPrefixes: LIST OF ROPE;
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];
pathPrefixes ← CONS[pathPrefix, pathPrefixes]; pathPrefix must have the form "/.../" or the form "[...]<...>"
FullFileName: PROC [shortName: ROPE, createTime: GMT ← 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
FullFileNameList: PROC [shortName: ROPE, createTime: GMT ← nullGMT] RETURNS[fullName: LIST OF ROPE];
Finds the list of all the full path names of a symbol or source file. Assumes that shortName has an appropriate extension. Returns the list containing 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 list of files. Returns NIL if no files are found. Note that this procedure is more useful than FullFileName only where the createTime = nullGMT.
OpenIt: PROC [shortName: ROPE, createTime: GMT ← nullGMT] RETURNS [fullName: ROPE, openFile: OpenFile];
Open a symbol or source file for read (using FullFileName and FS.Open) Returns [NIL, nullOpenFile] if file not found
END.