<> <> <> <> <> <> <> <> <> <> <> <> <> <> <<>> <> <<1. Version numbers should be retained in order to keep the validity of the hints in DF files. >> <<2. Don't move files that are already there.>> DIRECTORY Basics USING [Comparison, PartialComparison, UnsafeBlock], BasicTime USING [GMT, Now, nullGMT], CedarProcess USING [DoWithPriority, Priority], Commander USING [CommandProc, Handle, Register], CommanderOps USING [Failed, NextArgument], DFUtilities USING [DirectoryItem, FileItem, Filter, IncludeItem, ParseFromStream, ProcessItemProc, UsingList], FileNames, IO, IOClasses, PFS, PFSNames, PFSPrefixMap, Process USING [CheckForAbort, GetPriority, Pause, Priority, SecondsToTicks], RedBlackTree USING [Compare, Create, Delete, DestroyTable, EachNode, EnumerateIncreasing, GetKey, Insert, Lookup, Table], Rope, SharedErrors, TrickleChargeServer; TrickleChargeServerImpl: CEDAR MONITOR IMPORTS BasicTime, CedarProcess, Commander, CommanderOps, DFUtilities, FileNames, IO, IOClasses, PFS, PFSNames, PFSPrefixMap, Process, RedBlackTree, Rope, SharedErrors EXPORTS TrickleChargeServer = BEGIN <> GMT: TYPE = BasicTime.GMT; ROPE: TYPE = Rope.ROPE; STREAM: TYPE = IO.STREAM; PATH: TYPE = PFS.PATH; PFSErrorReportProc: TYPE = TrickleChargeServer.PFSErrorReportProc; TCReportProc: TYPE = TrickleChargeServer.TCReportProc; Switches: TYPE = PACKED ARRAY CHAR['a..'z] OF BOOL; TCType: TYPE = { fullDirectory, oneDF, allDFs, individualDFs }; TCInfoList: TYPE = LIST OF TCInfo; TCInfo: TYPE = REF TCInfoRec; TCInfoRec: TYPE = RECORD[ prefix, fromTranslation, toTranslation: ROPE, fromTranslationPath: PATH, otherArg: ROPE, -- for oneDF and allDFs prefixPath: PATH, fromPTable, toPTable: PFSPrefixMap.PrefixTableList, switches: Switches, -- switches in effect at argument capture time useCopy: BOOL ¬ TRUE, -- rather than retrieve tcType: TCType ¬ fullDirectory, fullCmd: ROPE, -- for TCReportProc to use tcReportHasBeenCalled: BOOL ¬ FALSE -- has a TCReportProc been called, if there is one(s) ]; FileEntry: TYPE = REF FileEntryRep; FileEntryRep: TYPE = RECORD [ fullSrcName: ROPE, <> fullSrcNamePath: PATH, uid: PFS.UniqueID, <> len: INT, <> state: FileEntryState <> ]; FileEntryState: TYPE = {init, fetching, storing, moved}; <> dirDoc: ROPE = " srcDir dstDir moves files from srcDir to dstDir -a fileName: append output messages to fileName -b: bestEfforts (ignore unknown prefixes) -d: debug (inhibits file transfer) -o fileName: output messages to new fileName -r: retrieve rather than copy -v: verify (no transfers, messages only for missing files) -x: debugging output "; allDfsDoc: ROPE = "prefixMapEntry fromTranslation toTranslation {subdirForDfs} moves files from srcDir to dstDir -a fileName: append output messages to fileName -b: bestEfforts (ignore unknown prefixes) -d: debug (inhibits file transfer) -m: move dfs even if errors -o fileName: output messages to new fileName -r: retrieve rather than copy -v: verify (no transfers, messages only for missing files) -x: debugging output "; oneDfDoc: ROPE = "prefixMapEntry fromTranslation toTranslation subDirAndDfName moves files from srcDir to dstDir -a fileName: append output messages to fileName -b: bestEfforts (ignore unknown prefixes) -d: debug (inhibits file transfer) -l: localDF (assumes df name is local or full ({not prefixMapEntry relative}) -m: move dfs even if errors -o fileName: output messages to new fileName -r: retrieve rather than copy -v: verify (no transfers, messages only for missing files) -x: debugging output "; <