DIRECTORY Commander, CommandTool, FS, IO, Rope; BootSmash: CEDAR PROGRAM IMPORTS Commander, CommandTool, FS, IO, Rope = {OPEN IO, ROPE; Smash: Commander.CommandProc = { names: LIST OF Rope.ROPE = CommandTool.ParseToList[cmd]; buffer: REF TEXT = NEW[TEXT[512]]; FOR each: LIST OF Rope.ROPE _ names, each.rest WHILE each # NIL DO inStream, outStream: IO.STREAM _ NIL; name: ROPE = each.first; bytes: NAT _ 0; timeBytes: PACKED ARRAY [0..3] OF CARDINAL = LOOPHOLE[BasicTime.ToPupTime[BasicTime.Now[]]]; IF Rope.Equal[name, "-n", FALSE] THEN {useNebula _ TRUE; LOOP}; IO.PutF[cmd.out, "Open %g", [rope[name]]]; inStream _ FS.StreamOpen[name ! FS.Error => {IO.PutF[cmd.out, "\n Error - %g\n", [rope[error.explanation]]]; LOOP}; ]; outStream _ FS.StreamOpen[ IF useNebula THEN Rope.Concat["/Nebula//", name] ELSE name, create ! FS.Error => {IO.PutF[cmd.out, "\n Error - %g\n", [rope[error.explanation]]]; LOOP}; ]; IO.PutRope[cmd.out, " ."]; bytes _ IO.GetBlock[inStream, buffer, 0, 512]; buffer[6+0] _ timeBytes[2]; buffer[6+1] _ timeBytes[3]; buffer[6+2] _ timeBytes[0]; buffer[6+3] _ timeBytes[1]; DO IO.PutRope[cmd.out, "."]; IO.PutBlock[outStream, buffer, 0, bytes]; bytes _ IO.GetBlock[inStream, buffer, 0, 512 ! IO.EndOfStream => EXIT]; ENDLOOP; IO.Close[outStream]; IO.Close[inStream]; IO.PutRope[cmd.out, "\n"]; ENDLOOP; }; Commander.Register[ "SmashBoot", Smash, "Smashes the date of a boot file so we can propagate changes."]; }. ŠBootSmash.mesa Russ Atkinson, May 31, 1984 2:22:34 am PDT We must scramble a certain 4 bytes in the file to be a funny-format date. Êg˜šœ™Jšœ*™*—J˜šÏk ˜ Jšœœœ˜%J˜—šœ œ˜Jš œœœ œœœ˜>—J˜˜ J˜Jšœœœœ ˜8J˜Jš œœœœœ˜"J˜J˜š œœœœœœ˜BJšœœœœ˜%Jšœœ˜Jšœœ˜šœ œœœ˜,Jšœ'˜/—J˜Jš œœœœœ˜?J˜Jšœ(˜*J˜šœ œ˜Jšœœ œ?œ˜VJ˜—J˜šœ œ ˜Jšœ œ œ ˜BJšœœ œ?œ˜VJ˜J˜—J˜Jšœ˜Jšœœ$˜.J˜JšœI™IJšœ˜Jšœ˜Jšœ˜Jšœ˜J˜š˜Jšœ˜Jšœ'˜)Jš œœ%œÏr œœ˜GJšœ˜J˜—J˜Jšœ˜Jšœ˜J˜Jšœ˜J˜J˜J˜Jšœ˜—J˜J˜J˜—˜J˜T—J˜J˜J˜J˜—…—¸©