DIRECTORY DFUtilities USING [DirectoryItem, FileItem, ParseFromStream, ProcessItemProc], FS USING [ComponentPositions, Copy, Error, ExpandName, StreamOpen], IO USING [Close, PutF, rope, STREAM], Rope USING [ROPE, Substr]; InstallFontsImpl: CEDAR PROGRAM IMPORTS DFUtilities, FS, IO, Rope EXPORTS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; STREAM: TYPE ~ IO.STREAM; Error: PUBLIC ERROR[reason: ROPE] = CODE; Install: PUBLIC PROC [out: STREAM, localDir: ROPE, remoteName: ROPE] = BEGIN ProcessItem: DFUtilities.ProcessItemProc = BEGIN WITH item SELECT FROM dir: REF DFUtilities.DirectoryItem => {root _ dir.path1}; file: REF DFUtilities.FileItem => { fullFName, toName: ROPE; cp: FS.ComponentPositions; [fullFName, ] _ FS.ExpandName[name: file.name, wDir: root]; [toName, cp] _ FS.ExpandName[name: file.name, wDir: localDir]; toName _ Rope.Substr[base: toName, start: 0, len: cp.ver.start-1]; toName _ FS.Copy[from: fullFName, to: toName, setKeep: TRUE, keep: 1, attach: FALSE]; -- don't attach it IO.PutF[out, "Copied %g => %g\n", IO.rope[fullFName], IO.rope[toName]]; }; ENDCASE => NULL; END; root: ROPE _ NIL; df: STREAM _ FS.StreamOpen[remoteName, read ! FS.Error => ERROR Error[error.explanation]]; DFUtilities.ParseFromStream[df, ProcessItem]; IO.Close[df]; END; END. ²InstallFontsImpl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Tim Diebert: April 9, 1987 3:13:47 pm PDT [item: REF ANY] RETURNS [stop: BOOL _ FALSE]; ΚŠ˜šœ™Icode™K–9[base: ROPE, start: INT _ 0, len: INT _ 2147483647]šœB˜BKšœ œ,œœΟc˜iKšœ œœ˜GKšœ˜—Kšœœ˜—Kšœ˜—Kšœœœ˜Kš œœœœ œ˜ZKšœ-˜-Kšœ ˜ Kšœ˜—K˜—Kšœ˜—…—ψ4