GGFileOps.mesa
Copyright Ó 1986, 1988, 1992 by Xerox Corporation. All rights reserved.
Last edited by Bier on August 7, 1987 2:18:34 pm PDT
Contents: Routines that manipulate file names or open and close files.
Pier, December 12, 1988 4:36:37 pm PST
Bier, August 23, 1989 6:38:21 pm PDT
Doug Wyatt, April 9, 1992 3:11 pm PDT
DIRECTORY
FeedbackTypes, InterpressInterpreter, Rope;
GGFileOps: CEDAR DEFINITIONS = BEGIN
MsgRouter: TYPE = FeedbackTypes.MsgRouter;
Generic File Name Operations
GetGenericFileName: PROC [opRope, fileName, wDir, defaultExt: Rope.ROPE, illegalExts: LIST OF Rope.ROPE, router: MsgRouter, emergency: BOOL ¬ FALSE] RETURNS [fullName: Rope.ROPE ¬ NIL, success: BOOL ¬ TRUE, versionSpecified: BOOL ¬ FALSE];
Given fileName (provided by a user perhaps) and a working directory, expands the filename in that directory, adding the default extension if none was provided. It reports any problems onto the feedback stream unless emergency = TRUE. If there are any problems, success is set to FALSE and a complaint on behalf of the opRope is posted. Otherwise, the resulting full path name is returned.
FNameToGName: PROC [name: Rope.ROPE] RETURNS [Rope.ROPE];
Takes a local name like "[]<>Users>Bier.pa>Gargoyle>Foo" into a global name like "[QueenFish]<Cedar>Users>Bier.pa>Gargoyle>Foo".
FilenameMinusExtension: PROC [wholeName: Rope.ROPE] RETURNS [firstPart: Rope.ROPE];
Convenience File Name Operations for Gargoyle Use
GetInterpressFileName: PROC [opRope, ipName: Rope.ROPE, currentWDir: Rope.ROPE, router: MsgRouter] RETURNS [fullName: Rope.ROPE ¬ NIL, success: BOOL ¬ TRUE];
[fullName, success, ----] ← GetGenericFileName[opRope, ipName, currentWDir, "IP", LIST["gargoyle", "script", "mesa", "tioga"], feedback];
GetGargoyleFileName: PROC [opRope, ggName: Rope.ROPE, currentWDir: Rope.ROPE, router: MsgRouter, emergency: BOOL ¬ FALSE] RETURNS [fullName: Rope.ROPE ¬ NIL, success: BOOL ¬ TRUE, versionSpecified: BOOL ¬ FALSE];
[fullName, success, versionSpecified] ← GetGenericFileName[opRope, ggName, currentWDir, "gargoyle", LIST["IP", "interpress", "script", "mesa", "tioga"], feedback, emergency];
GetScriptFileName: PROC [opRope, scriptName: Rope.ROPE, currentWDir: Rope.ROPE, router: MsgRouter] RETURNS [fullName: Rope.ROPE ¬ NIL, success: BOOL ¬ TRUE];
[fullName, success, ----] ← GetGenericFileName[opRope, scriptName, currentWDir, "script", LIST["gargoyle", "IP", "interpress", "mesa", "tioga"], feedback];
Generic File Opening Operations
OpenInterpressOrComplain: PROC [opRope: Rope.ROPE, router: MsgRouter, fullName: Rope.ROPE] RETURNS [ipMaster: InterpressInterpreter.Master, success: BOOL];
END.