DIRECTORY BasicTime USING [Now], IO USING [Error, PutF, rope, time, STREAM], Commander USING [CommandProc, Register], CommandTool USING [ArgumentVector, Parse, Failed], Convert USING [IntFromRope, Error], Interpreter USING [EvaluateToRope], Process USING [ Pause, SecondsToTicks], ProcessExtras USING [CheckForAbort] ; WatchAlpineLogImpl: CEDAR PROGRAM IMPORTS BasicTime, Commander, Convert, IO, Process, ProcessExtras, CommandTool, Interpreter EXPORTS ~ BEGIN Sampler: PROC [ out: IO.STREAM, sampleInterval: CARDINAL ] ~ { DO i: INT; out.PutF["At %g the tail of the log is at %g \n", IO.time[BasicTime.Now[]], IO.rope[Interpreter.EvaluateToRope[ "LogBasicCoreImpl.chunkTable[LogBasicCoreImpl.tail].chunk.pageRun.firstPage"].result] ! IO.Error => EXIT; ]; FOR i IN [1 .. sampleInterval] DO ProcessExtras.CheckForAbort[]; Process.Pause[Process.SecondsToTicks[60]]; ENDLOOP; ENDLOOP; }; SamplerCommand: Commander.CommandProc = { seconds: INT; secondsCard: CARDINAL; argv: CommandTool.ArgumentVector _ CommandTool.Parse[cmd ! CommandTool.Failed => {msg _ errorMsg; GO TO oops}]; IF argv.argc # 2 THEN {msg _ "Usage: WatchAlpineLog "; GO TO oops}; seconds _ Convert.IntFromRope[argv[1] ! Convert.Error => {msg _ "Bad arg"; GO TO oops}]; IF seconds NOT IN [0..LAST[CARDINAL]] THEN {msg _ "Bad arg"; GO TO oops}; secondsCard _ seconds; Sampler[cmd.out, secondsCard]; EXITS oops => result _ $Failure; }; Commander.Register[key: "WatchAlpineLog", proc: SamplerCommand, doc: "Periodically prints the page number of the tail of the Alpine Log"] END. WatchAlpineLog.mesa Periodically print the page number of the tail record of the Alpine Log. Just how much log space does Alpine use anyway? Carl Hauser, April 30, 1985 9:17:41 am PDT [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL] Κ•˜J™™yIcode™*—JšΟk ˜ Jšœ œ˜Jšœœ#˜+Jšœ œ˜(Jšœ œ!˜2Jšœœ˜#Jšœ#˜#J˜'J˜#J˜šœ ˜!JšœT˜[Jšœ˜—šœ˜J˜—šΟnœœ#œ˜>š˜J˜šœΕ˜ΕKšœœ œ˜Kšœ˜—šœ˜!J˜J˜*Jšœ˜—Jšœ˜—J˜J˜—•StartOfExpansionL -- [cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL]˜)JšΠckH™HKšœ œ˜ Kšœ œ˜šœ ˜ KšœAœœ˜N—Kšœœ+œœ˜LKšœKœœ˜XKšœ œœœœœœœ˜IKšœ˜Kšœ˜Kšœ˜ K˜J˜J˜J˜J–x[key: ROPE, proc: Commander.CommandProc, doc: ROPE _ NIL, clientData: REF ANY _ NIL, interpreted: BOOL _ TRUE]˜‰Jšœ˜——…— ³