<> <> <> <> <> <> <> <> <> <> <> <<>> <> <<1. Version numbers should be retained in order to keep the validity of the hints in DF files. This requires using STP (unfortunately).>> <<2. Don't clutter the local disk with cached copies of transferred files.>> <<3. Don't move files that are already there.>> <<4. Support running this program in background to allow periodic updating of one directory from another. This is particularly useful for CedarChest.>> DIRECTORY BasicTime USING [GMT, Now, nullGMT], CedarProcess USING [DoWithPriority, Priority], Commander USING [CommandProc, Handle, Register], CommandTool USING [ArgumentVector, Failed, Parse], DFUtilities USING [DirectoryItem, FileItem, IncludeItem, ParseFromStream, ProcessItemProc], FS USING [Copy, defaultStreamOptions, EnumerateForInfo, Error, ExpandName, FileInfo, InfoProc, StreamOpen, StreamOptions], FSBackdoor USING [EnumerateCacheForInfo, InfoProc], FSPseudoServers USING [TranslateForWrite], GVBasics USING [Connect], GVNames USING [ConnectInfo, GetConnect], IO USING [Close, PutChar, PutF, PutF1, PutFR1, PutRope, STREAM], List USING [CompareProc], PrincOpsUtils USING [], Process USING [CheckForAbort, GetPriority, Pause, Priority, SecondsToTicks], RedBlackTree USING [Compare, Create, Delete, DestroyTable, EachNode, EnumerateIncreasing, GetKey, Insert, Lookup, Table], Rope USING [Cat, Compare, Concat, Equal, Fetch, Find, Flatten, Length, Match, Replace, ROPE, Run, SkipTo, Substr], STP USING [Close, Connect, Create, Error, Handle, IsOpen, Login, Open, Store], Tempus USING [Now, PackedSeconds, PackedToSeconds, Parse], UserCredentials USING [Get]; TrickleChargeServerImpl: CEDAR PROGRAM IMPORTS BasicTime, CedarProcess, Commander, CommandTool, DFUtilities, FS, FSBackdoor, FSPseudoServers, GVNames, IO, Process, RedBlackTree, Rope, STP, Tempus, UserCredentials = BEGIN <> GMT: TYPE = BasicTime.GMT; ROPE: TYPE = Rope.ROPE; STREAM: TYPE = IO.STREAM; Switches: TYPE = PACKED ARRAY CHAR['a..'z] OF BOOL; PairList: TYPE = LIST OF Pair; Pair: TYPE = RECORD [ src: ROPE, <> dst: ROPE, <> switches: Switches, <> timeRestriction: ROPE <> ]; FileEntry: TYPE = REF FileEntryRep; FileEntryRep: TYPE = RECORD [ name: ROPE, <> short: ROPE, <> date: GMT, <> len: INT, <> state: FileEntryState <> ]; FileEntryState: TYPE = {init, fetching, storing, moved}; <> doc: ROPE = "{srcDir dstDir}* moves files from srcDir (or DF) to dstDir -c: connect (to destination host) -d: debug (inhibits file transfer) -r: repeat (keep doing the transfer forever) -v: verify (no transfers, messages only for missing files) -q: quick (enumerate only the df files) See documentation for specification of time restrictions. "; <