1 Lisp Library Modules, Medley Release 1.15, COPYFILES 1 Lisp Library Modules, Medley Release 1.15, COPYFILES COPYFILES 1 COPYFILES 1 COPYFILES 6 CopyFiles(COPYFILES NIL CopyFiles NIL NIL 45) makes it easy to copy or move groups of files from one place to another. Installation 1 Load COPYFILES.LCOM from the library. Function 1 (COPYFILES(COPYFILES (function) NIL NIL NIL 45) SOURCE DESTINATION OPTIONS) [Function] 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 one-to-one match of the wild card characters (*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. (See examples below.) Note: You must use *s if you want to name files. If you do not, the COPYFILES code assumes that any DESTINATION specified without *s in it is a destination directory. OPTIONS is a list (if you have only one and it is a symbol, you can supply it as a symbol) that may include one or more of the options specified below. Note: If the destination is a non-existent NS subdirectory, COPYFILES asks whether it should create it. If you answer YES, then it creates the subdirectory. If you answer NO, it aborts without processing any files. OPTION: Conversation Mode(CONVERSATION% MODE NIL Conversation% Mode NIL NIL 45) 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 period (.) for each file moved/copied. OPTION: Query Mode(QUERY% MODE NIL Query% Mode NIL NIL 45) You can specify whether CopyFiles should ask for confirmation before each transfer. 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. OPTION: Version Control(VERSION% CONTROL NIL Version% Control NIL NIL 46) CopyFiles normally uses the Lisp function COPYFILE(COPYFILE (function) NIL NIL NIL 46) to create a new file. It also usually copies only 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). Note: When * is used as the source version number, be sure to specify ALLVERSIONS. This is important because some devices list files by version number from highest to lowest, while by default the version numbers at the destination are assigned in ascending order. Hence, if ALLVERSIONS is not specified, the versions may be reversed, as can be verified by looking at the creation dates. OPTION: When To Copy(WHEN% TO% COPY NIL When% To% Copy NIL NIL 46) CopyFiles normally compares the creation dates(CREATION% DATES NIL creation% dates NIL NIL 46) of the file on the source and any matching file on the destination to determine whether it is necessary 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 only if there isn't a file of the same name on the destination. 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 the highest version if it doesn't exist on the destination or if an older creation date exists, and print out messages about all files considered. OPTION: Clean-Up After Copying Files(CLEAN-UP% AFTER% COPYING% FILES NIL Clean-Up% After% Copying% Files NIL NIL 46) CopyFiles can be instructed to delete some files after it has finished copying. 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. Limitations 1 The creation date comparison does not work when either the source or the destination does not support creation dates. For example, the TCP-IP protocol doesn't support any way to find out the creation date of a remote file. For this reason, COPYFILES can only be used in ALWAYS mode when using a TCP-IP protocol(TCP-IP% PROTOCOL NIL TCP-IP% protocol NIL NIL 47). Examples 1 (COPYFILES '{ERIS}*.MAIL '{PHYLUM}OLD-*.MAIL) Copies any mail file on {ERIS} to {PHYLUM}, copying FOO.MAIL to OLD-FOO.MAIL. (COPYFILES '{ERIS}*.MAIL '{PHYLUM}OLD-*.MAIL 'RENAME) Uses RENAMEFILE instead. (COPYFILES '({DSK}TEST {DSK}WEST) '{PHYLUM}) Copies the files TEST and WEST from {DSK} to {PHYLUM}. (COPYFILES '{PHYLUM}*.AR '{PHYLEX:} '=A) Copies all 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)) Copies the AR index to {DSK}, replacing any older version that is already there. COPYFILES({DSK}*.; {FLOPPY}) Copies all files on {DSK} that have no file name extensions to {FLOPPY}. (COPYFILES '{ERIS} '{PHYLUM} '(#A PURGE)) Makes {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. [This page intentionally left blank] (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "") STARTINGPAGE# 45) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (TEXT NIL NIL (54 54 504 702) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (54 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGV) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE VERSOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL)))))8x x8 8 8x lx8 ,ll8HH 2Hll,HH -$$T5l5ll,2Hl 2HH 22HH3T-T-TF PAGEHEADING VERSOHEADF PAGEHEADING RECTOHEADE PAGEHEADINGFOOTINGVE PAGEHEADINGFOOTINGR HELVETICA HELVETICA  HELVETICA  HELVETICA CLASSIC TITAN TITAN CLASSIC  HELVETICAMODERN MODERNMODERNMODERNMODERN  HRULE.GETFNMODERN  5 HRULE.GETFNMODERN  5  HRULE.GETFNMODERN    HRULE.GETFNMODERN    HRULE.GETFNMODERN  $IM.INDEX.GETFNK    HRULE.GETFNMODERN    HRULE.GETFNMODERN  %IM.INDEX.GETFN    ' o   F   8  < 23* 6IM.INDEX.GETFN A  #  0     (IM.INDEX.GETFN HELVETICA  T  D     2IM.INDEX.GETFN *$IM.INDEX.GETFNMODERN       *  0  aF  f .IM.INDEX.GETFN .0IM.INDEX.GETFN    _  D   `  D   E 9 A  PIM.INDEX.GETFN P     V   HRULE.GETFNMODERN   "2IM.INDEX.GETFN    HRULE.GETFNMODERN  :    B   4 5I A5 & 7  0) $  oz