BringDAWorldImpl.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Created by Bertrand Serlet, October 21, 1986 10:11:12 pm PDT
Bertrand Serlet October 28, 1986 3:56:18 pm PST
DIRECTORY
BasicTime, Commander, DFClosure, DFUtilities, FileNames, FS, IO, MessageWindow, ProcessProps, Rope, SystemVersion;
BringDAWorldImpl:
CEDAR
PROGRAM
IMPORTS DFUtilities, FileNames, FS, IO, MessageWindow, ProcessProps, Rope, SystemVersion
ROPE: TYPE ~ Rope.ROPE;
ROPES: TYPE ~ LIST OF ROPE;
STREAM:
TYPE =
IO.
STREAM;
File: DFClosure.FileProc = {
out: STREAM = NARROW [ProcessProps.GetProp[$CommanderHandle], Commander.Handle].out;
localName: ROPE = DFUtilities.RemoveVersionNumber[name];
serverName: ROPE = Rope.Cat[from, name];
BEGIN
attachedTo: ROPE;
created: BasicTime.GMT;
[attachedTo: attachedTo, created: created] ← FS.FileInfo[name: localName, remoteCheck: FALSE ! FS.Error => GOTO Copy]; -- if the file is inexistent, we copy it!
IF created=date.gmt THEN RETURN; -- already there
GOTO Copy;
EXITS
Copy => [] ←
FS.Copy[
to: localName, from: serverName, wantedCreatedTime: date.gmt, attach:
TRUE
! FS.Error => out.PutF["%g can not be copied: %g.\n", IO.rope[serverName], IO.rope[error.explanation]];
];
END;
};
daTop: ROPE = IO.PutFR["/DATools/DATools%g.%g/Top/*.df", IO.int[SystemVersion.release.major], IO.int[SystemVersion.release.minor]];
daWorld:
ROPE =
IO.PutFR["/DATools/DATools%g.%g/Top/DAWorldMap.df",
IO.int[SystemVersion.release.major],
IO.int[SystemVersion.release.minor]];
Import: DFClosure.ImportProc = {
RETURN [
SELECT
TRUE
FROM
Rope.Match[daTop, FileNames.ConvertToSlashFormat[dfName], FALSE] => all,
ENDCASE => public];
};
Error: DFClosure.ErrorProc = {};
Message: DFClosure.MessageProc = {MessageWindow.Append[message,
TRUE]};