home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / z3util / comp28.lbr / COPYIF.ZQX / COPYIF.ZEX
Encoding:
Text File  |  1993-06-07  |  1.4 KB  |  33 lines

  1. ^.
  2. ^<^|
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^|
  4. ;                                                         ;^|
  5. ;       ZEX file to copy from source to destination       ;^|
  6. ;       if the destination file does not exist or if      ;^|
  7. ;       the destination file is different than the        ;^|
  8. ;       source file.                                      ;^|
  9. ;                                                         ;^|
  10. ;       Syntax:                                           ;^|
  11. ;         COPIF du:source du:destination                  ;^|
  12. ;                                                         ;^|
  13. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;^|
  14. ^>
  15. ^#
  16. ^&
  17. COMP $1 $2 /T ;note compare source to destination with test only option^|
  18. if 9 1 ;note If source not found^|
  19.   ECHO --           $1 NOT FOUND^|
  20. else^|
  21.   if 9 2 ;note If destination not found^|
  22.     ECHO --       DESTINATION FILE does not exist, copying $1 to DESTINATION^|
  23.     CPY $2=$1^|
  24.   else^|
  25.     if 9 3 ;note If a difference was found^|
  26.       ECHO --           Files are different, updating $2 with $1^|
  27.       CPY $2=$1^|
  28.     else^|
  29.       ECHO --                  Files are the same, update not required.^|
  30.     fi    ;note if 9 3^|
  31.   fi    ;note if 9 2^|
  32. fi    ;note if 9 1^|
  33. ^#