DIRECTORY Commander, CommandTool, DFUtilities, FS, IO, Rope; PrintDF: CEDAR PROGRAM IMPORTS Commander, CommandTool, DFUtilities, FS, IO, Rope = BEGIN ROPE: TYPE = Rope.ROPE; PrintADFFile: PROC [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL] --Commander.CommandProc-- = BEGIN commandLineStream: IO.STREAM _ IO.RIS[cmd.commandLine]; dfName: ROPE _ commandLineStream.GetTokenRope[IO.IDProc].token; switches: ROPE _ commandLineStream.GetLineRope[]; dfStream: IO.STREAM _ NIL; printCommand: ROPE _ Rope.Cat["Print ", switches]; dir: ROPE _ "!?No Directory?!"; PerItem: PROC [item: REF ANY] RETURNS [stop: BOOL _ FALSE] = { WITH item SELECT FROM di: REF DFUtilities.DirectoryItem => dir _ di.path1; fi: REF DFUtilities.FileItem => printCommand _ printCommand.Cat[" ", dir, fi.name]; ii: REF DFUtilities.ImportsItem => NULL; ii: REF DFUtilities.IncludeItem => NULL; wi: REF DFUtilities.WhiteSpaceItem => NULL; ENDCASE => ERROR}; commandLineStream.Close[]; dfStream _ FS.StreamOpen[dfName !FS.Error => {msg _ IO.PutFR["FS.Error[code: %g, explanation: %g]", IO.atom[error.code], IO.refAny[error.explanation]]; CONTINUE}]; IF dfStream = NIL THEN RETURN [$Failure, msg]; DFUtilities.ParseFromStream[in: dfStream, proc: PerItem]; dfStream.Close[]; result _ CommandTool.DoCommand[commandLine: printCommand, parent: cmd]; END; Commander.Register[key: "PrintDF", proc: PrintADFFile, doc: "Print all the files mentioned in a DF file"]; END. NPrintDF.Mesa Last Edited by: Spreitzer, August 18, 1984 11:11:43 pm PDT Κσ˜Icode™ J™:K˜KšΟk œ&œœ˜šœœ˜Kšœœ-˜4KšœœL˜SKšœœœ˜(Kšœœœ˜(Kšœœœ˜+Kšœœ˜——Kšœ˜Kš œ œœœ.œœœ˜£Kšœ œœœ˜.Kšœ9˜9K˜K˜GKšœ˜—K˜K˜jK˜Kšœ˜——…—²σ