SystemNames.mesa
Copyright Ó 1987, 1989, 1991 by Xerox Corporation. All rights reserved.
Doug Wyatt, January 24, 1987 6:57:16 pm PST
JKF September 13, 1988 3:14:50 pm PDT
Willie-Sue, March 15, 1989 5:07:43 pm PST
Willie-s, August 19, 1991 2:10 pm PDT
Michael Plass, August 19, 1991 1:12 pm PDT
DIRECTORY
Rope USING [ROPE];
SystemNames: CEDAR DEFINITIONS ~ {
ROPE: TYPE ~ Rope.ROPE;
UserName: PROC RETURNS [ROPE];
... returns the short name of the current user; "wyatt", for example.
MachineName: PROC RETURNS [ROPE];
... returns the short name of the current machine; "chorus", for example.
Release: TYPE ~ { current, previous, next };
ReleaseName: PROC [release: Release ¬ $current] RETURNS [ROPE];
... returns the Cedar release number (without patch number) as a rope.
Examples:
ReleaseName[] --> "7.3"
ReleaseName[$previous] --> "7.2"
ReleaseDir: PROC [dir: ROPE ¬ NIL, release: Release ¬ $current] RETURNS [ROPE];
... appends a release number to the directory as follows:
Examples:
ReleaseDir[] --> "Cedar7.3"
ReleaseDir["DATools", $previous] --> "DATools7.2"
ReleaseSubDir: PROC [subDirs: ROPE ¬ NIL, release: Release ¬ $current] RETURNS [ROPE];
... inserts the release number in front of the subdirectory as follows:
Examples:
ReleaseSubDir[] --> "7.3"
ReleaseSubDir["Top"] --> "7.3/Top"
ReleaseSubDir["Foo/Bar", $previous] --> "7.2/Foo/Bar"
ReleaseOption: TYPE ~ {releaseDir, releaseSubDir, releaseOmitted};
MachineLocalDir: PROC [subDirs: ROPE ¬ NIL, option: ReleaseOption ¬ $releaseSubDir,
release: Release ¬ $current] RETURNS [ROPE];
Examples (for sunos & unix):
LocalDir[] --> "/tmp/Cedar/7.3/"
LocalDir["Commands"] --> "/tmp/Cedar/7.3/Commands/"
LocalDir["Users/Wyatt", $releaseOmitted] --> "/tmp/Cedar/Users/Wyatt/"
CedarDir: PROC [subDirs: ROPE ¬ NIL, release: Release ¬ $current, dir: ROPE ¬ NIL]
RETURNS [ROPE];
Examples:
CedarDir[] --> "/Cedar7.3/"
CedarDir["Top"] --> "/Cedar7.3/Top/"
CedarDir["Top", $previous] --> "/Cedar7.2/Top/"
CedarDir[dir: "CedarChest", subDirs: "Top"] --> "/CedarChest7.3/Top/"
SimpleHomeDirectory: PROC RETURNS [ROPE];
in the sunos world, this is the user's unix home directory, with a trailing /
UserCedarDir: PROC [subDirs: ROPE, option: SystemNames.ReleaseOption ¬ $releaseOmitted,
release: SystemNames.Release ¬ $current] RETURNS [ROPE];
... constructs a path in the current user's cedar home directory, which is .cedar (this is a directory in which programs can put files that the user does not need to know about; it can be a vux or an ux directory)
Examples:
UserCedarDir[] --> "~/.cedar/"
UserCedarDir["tipc"] --> "~/.cedar/tipc/"
UserCedarDir["System", $releaseDir] --> "~/.cedar/7.3/System/"
}.