XEROX Lisp Library Packages 2 4 1 1 COPYFILES 1 4 4 4 INTRODUCTION This package makes it easy to copy or move groups of files from one place to another. (COPYFILES source destination options) Copies the files designated by source to the place designated by destination. source is a pattern such as given to DIRECTORY or DIR; it can also be a list of file names. destination is either a directory name, or a file-name pattern, with a 1-1 match of "*"s in destination to "*"s in source. (The number of *'s in each source pattern needs to match the number of *'s in each destination pattern.) The argument options is a (list of) options (if you have only one and it's an atom, you can supply it as an atom), as follows: 1. You can specify how verbose COPYFILES is about what it is doing: QUIET Don't print anything while working. (OUTPUT listfile) Print the name of each file that gets copied on listfile. (OUTPUT T) is the default. TERSE Only print a "." for each file moved/copied. 2. You can specify whether COPYFILES should ask before each transfer. Default is not to ask. ASK Ask each time before moving/copying a file (default is to not ask). (ASK N) Ask, with default to No after DWIMWAIT seconds. (ASK Y) Ask, with default to Yes after DWIMWAIT seconds. 3. COPYFILES normally uses COPYFILE to create a new file. It also usually only copies the "highest version", and creates a new version at the destination. Alternatively, you can specify any of the following: RENAME or MOVE Use RENAMEFILE instead of COPYFILE, i.e., the source is deleted afterwards. ALLVERSIONS Copy all versions, and preserve version numbers. REPLACE If a file by the same name exists on the destination, overwrite it (don't create a new version) 4. After COPYFILES gets done, it can be instructed to delete some files afterward: PURGE This involves a separate pass (afterwards): any file on the *destination* which doesn't have a counterpart on the *source* is deleted. PURGESOURCE Converse of PURGE (and used by it): if the file is on the source and not on the destination, delete it. COPYFILES normally compares the creation dates of the file on the source and any matching file on the destination to determine whether it is necssary to copy. The following options are mutually exclusive: ALWAYS Always copy the file. > Copy only when a file by the same name but an earlier creation date exists on the destination. >A Similar to >, but also copy if the file doesn't exist on the destination, i.e., > ALWAYS. # Copy only when a file by the same name but a different creation date exists on the destination. #A Similar to #, but also copy if the file doesn't exist on the destination, i.e. # ALWAYS. =A Copy if there isn't a file of the same name on the destination; if there is, leave it, but if the file on the source doesn't exist at all on the destination, *do* copy it. Not all combinations of options make sense; for example, ALLVERSIONS probably doesn't work right with any date comparison algorithms. The default setting is (>A), that is, copy highest version if it either doesn't exist on the destination or only an older creation date exists, and to print out messages about all files considered. EXAMPLES (COPYFILES '{ERIS}*.MAIL '{PHYLUM}OLD-*.MAIL) will copy the any mail file on {Eris} to {Phylum}, renaming FOO.MAIL to OLD-FOO.MAIL. (COPYFILES '{ERIS}*.MAIL '{PHYLUM}OLD-*.MAIL 'RENAME) will use RENAMEFILE instead. (COPYFILES '({DSK}TEST {DSK}WEST) '{PHYLUM}) will move the files TEST and WEST from {DSK} to {PHYLUM}. (COPYFILES '{PHYLUM}*.AR '{PHYLEX:}ARS> '>A) will copy all of the ARs on {PHYLUM} to the Phylex NS file server; if any are already there, it won't bother copying them. (COPYFILES '{PHYLUM}AR.INDEX '{DSK}AR.INDEX '(>A REPLACE)) will copy the AR index to {DSK}, replacing any older version that is already there. COPYFILES({DSK}*.; {FLOPPY}) will copy all files on {DSK} with no extension to {FLOPPY}. (COPYFILES '{ERIS} '{PHYLUM} '(#A PURGE)) will make {Phylum} look like {ERIS}; bringing over any file that isn't already on Phylum and then deleting the ones that were on {PHYLUM} and aren't on {ERIS} any more. (LIST ((PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 24 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 24 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 24 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))) Č ŠŠ8ŠŠ8 4ŠŠ8ŠŠ8ČČČ PAGEHEADINGBOO HELVETICA  HELVETICA HELVETICA  HELVETICA HELVETICA LOGO HELVETICA HELVETICA HRULE.GETFN HELVETICA HRULE.GETFN HELVETICA HRULE.GETFN HRULE.GETFN HELVETICA  HRULE.GETFN HELVETICA HRULE.GETFN HRULE.GETFN HRULE.GETFN HELVETICA V  V Q  2 kD*g3]I89Đ[=hStÍb^c]°†Č BjJ4B<„DT<BżǍzš