DIRECTORY BasicTime, Commander, CommanderOps, Convert, DFUtilities, IO, PFS, PFSNames, Process, Rope, VersionMap; CheckFileDatesImpl: CEDAR PROGRAM IMPORTS BasicTime, Commander, CommanderOps, Convert, DFUtilities, IO, PFS, PFSNames, Process, VersionMap = BEGIN ROPE: TYPE = Rope.ROPE; GMT: TYPE = BasicTime.GMT; PATH: TYPE = PFS.PATH; star: PATH ~ PFS.PathFromRope["*"]; CheckFileDates: Commander.CommandProc = { start, end: GMT; arg: ROPE; dir: ROPE; count: CARDINAL ¬ 0; noVersion, latest: PATH; OneFile: PFS.InfoProc ~ { thisGMT: GMT; thisV: PFSNames.Version; found, dateRope: ROPE; IF fileType = PFS.tDirectory THEN { PFS.EnumerateForInfo[PFSNames.Cat[fullFName, star], OneFile]; RETURN; }; thisGMT ¬ uniqueID.egmt.gmt; IF ( count ¬ count + 1 ) MOD 100 = 0 THEN { IF count MOD 1000 = 0 THEN cmd.out.PutF1[" (%g)", [cardinal[count]] ] ELSE cmd.out.PutRope["."]; Process.CheckForAbort[]; }; IF BasicTime.Period[from: start, to: thisGMT] < 0 THEN RETURN[TRUE]; IF BasicTime.Period[from: thisGMT, to: end] < 0 THEN RETURN[TRUE]; dateRope ¬ DFUtilities.DateToRope[[explicit, thisGMT]]; thisV ¬ PFSNames.ShortName[fullFName].version; found ¬ PFS.RopeFromPath[fullFName]; latest ¬ PFS.FileLookup[PFSNames.SetVersionNumber[fullFName, [highest]], NIL]; IF PFSNames.EqualVersions[thisV, PFSNames.ShortName[latest].version] THEN { mapList: VersionMap.MapList ¬ VersionMap.MapListForName[found]; mnList: VersionMap.MapAndNameList ¬ VersionMap.ShortNameToNames[mapList, VersionMap.ShortName[found]]; IF mnList = NIL THEN cmd.out.PutF["\n%g (%g - not in version map)\n", [rope[found]], [rope[dateRope]] ] ELSE cmd.out.PutFL["\n **%l%g%l (%g)\n", LIST[[rope["b"]], [rope[found]], [rope["B"]], [rope[dateRope]]] ] } ELSE cmd.out.PutF["\n%g (%g - not latest)\n", [rope[found]], [rope[dateRope]] ]; RETURN[TRUE]; }; start ¬ Convert.TimeFromRope[arg ¬ CommanderOps.NextArgument[cmd]]; end ¬ Convert.TimeFromRope[arg ¬ CommanderOps.NextArgument[cmd]]; dir ¬ CommanderOps.NextArgument[cmd]; cmd.out.PutF["\n***Starting CheckFileDates at %g, looking for dates between %g and %g\n", [time[BasicTime.Now[]]], [time[start]], [time[end]] ]; PFS.EnumerateForInfo[PFSNames.Cat[PFS.PathFromRope[dir], star], OneFile]; cmd.out.PutF["\n***Done with CheckFileDates at %g (%g files examined)\n", [time[BasicTime.Now[]]], [cardinal[count]] ]; }; Commander.Register["CheckFileDates", CheckFileDates, "syntax is start end dirToEnumerate"]; END. ΰ CheckFileDatesImpl.mesa Copyright Σ 1991, 1992 by Xerox Corporation. All rights reserved. Willie-s, August 10, 1992 1:54 pm PDT ** check if this is the latest version of this file see if file is in the version maps Κ­•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ7™BK™%K™—šΟk ˜ K˜ K˜ K˜ K˜K˜ Kšžœ˜Kšžœ˜K˜ K˜K˜K˜ K˜—šΟnœžœž˜!Kšžœ;žœžœ˜hKšœž˜K˜Kšžœžœžœ˜Kšžœžœ žœ˜Kšžœžœžœžœ˜Kšœžœžœ˜#K˜šŸœ˜)Kšœ žœ˜Kšœžœ˜ Kšœžœ˜ Kšœžœ˜Kšœžœ˜šŸœžœ ˜Kšœ žœ˜ K˜Kšœžœ˜šžœ žœ žœ˜#Kšžœ:˜=Kšžœ˜K˜—K˜šžœžœ žœ˜+Kšžœžœ žœ-žœ˜aK˜K˜—Kšžœ0žœžœžœ˜DKšžœ.žœžœžœ˜BK™3K˜7K˜.Kšœžœ˜$Kšœ žœ=žœ˜NšžœCžœ˜KK™"K˜?K˜fšžœ žœžœS˜gKšžœ%žœ=˜j—K˜KšžœL˜P—Kšžœžœ˜ K˜—K˜CK˜AK˜%Kšœ˜Kšžœžœ$˜IKšœw˜wK˜K˜—Kšœ[˜[K˜Kšžœ˜——…— t