home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug144.arc / ACOPY30.LBR / ACOPY30.DYC / ACOPY30.DYC
Text File  |  1990-02-17  |  22KB  |  499 lines

  1. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. *                                                               *
  3. *                           A C O P Y                           *
  4. *                                                               *
  5. *                 An Enhanced ZCPR3-Compatible                  *
  6. *                       File Copy Utility                       *
  7. *                                                               *
  8. *                     Copyright (c) 1986-90                     *
  9. *                              by                               *
  10. *                          Terry Hazen                          *
  11. *                     21460 Bear Creek Road                     *
  12. *                      Los Gatos, CA 95030                      *
  13. *                                                               *
  14. *                Voice.......... (408) 354-7188                 *
  15. *                Saratoga RBBS.. (408) 354-5934                 *
  16. *                Zee-Machine.... (408) 245-1420                 *
  17. *                Ladera Znode... (213) 670-9465                 *
  18. *                                                               *
  19. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  20.  
  21.  
  22. Lastest Revision
  23. ----------------
  24.  
  25. Version 3.0 - 02/16/90   Adds source and destination disk
  26.      directory caching in RAM for faster copying, two new options
  27.      Should now run under CP/M 3.0.  See ACOPY30.HIS for revision
  28.      history.
  29.  
  30. =================================================================
  31.  
  32.  
  33. Overview
  34. --------
  35.  
  36. ACOPY (Attribute COPY) is an enhanced Z80 file copy utility for
  37. use with CP/M 2.2 or 3.0, or ZCPR3 CCP's running under CP/M 2.2,
  38. CP/M 3.0, Z80DOS, ZRDOS, ZSDOS/ZDDOS and other extended DOS's.
  39.  
  40. ACOPY, originally based on David Jewett, III's PPIP12, was
  41. developed as a fast, general purpose file copy utility with
  42. flexible command line option control over many aspects of the
  43. copy process, and more specifically to help simplify the command
  44. line script required to copy groups of files with unrelated names
  45. to a RAM disk.  It does this by optionally copying only those
  46. files that have any of the specified filename attributes (the
  47. high bits of the filename and filetype bytes) F1 through F7 set.
  48. Filename attributes may be set using the ZRDOS utility SFA (Set
  49. File Attributes) or a similar CP/M Public Domain utility such as
  50. DA.  Another option allows copying only directory and not system
  51. files.  See the 'Options' section for information on the rest of
  52. ACOPY's command line options.
  53.  
  54. ACOPY automatically supports DOS datestamping when it operates
  55. under CP/M 3.0, Z80DOS or ZSDOS.  See the 'DOS Datestamping'
  56. section for more information.
  57.  
  58. ACOPY is fully ZCPR3 compatible when operating in a ZCPR3
  59. environment, accepting both the DIR: and DU: forms and checking
  60. the environment for the validity of the drive and user specified,
  61. whether it is to be operating in a quiet environment and the name
  62. the program was called by for use in the command line HELP
  63. message.  ACOPY will operate using the ZCPR3 GO command.  Errors
  64. will cause the ZCPR3 program error flag to be set.
  65.  
  66. When ACOPY operates in a non-ZCPR3 environment, the required
  67. information is obtained from internal locations, which may be
  68. patched to suit your system as described in the file ACOPY.PAT.
  69. ACOPY will not accept the DIR: form when operating in a non-ZCPR3
  70. environment.
  71.  
  72.  
  73. Disk Directory Caching
  74. ----------------------
  75.  
  76. ACOPY30 adapts the ideas developed by Hal Bower in his SPEEDUP
  77. disk directory buffer RSX to cache both source and destination
  78. disk directories in RAM for extra fast copying.  All references
  79. to source and destination disk directory entries, up to a maximum
  80. of 256 entries per directory, are made to the cached RAM copies,
  81. eliminating the time required to move the disk drive head to the
  82. directory track, read the required directory record and then move
  83. the head back each time a directory reference is required.  All
  84. references to directory entries not in the RAM cache are made to
  85. the physical disk directories as usual.  When the copy process is
  86. completed, all changed cached source and directory directory
  87. records are then written back to the appropriate disks.
  88.  
  89. While actual file copying times are very hardware and system
  90. dependent, directory caching can significantly improve copying
  91. speeds, especially when using floppy disks.  ACOPY30 performed a
  92. specific 18 file/204k floppy disk file copy test 43% faster than
  93. ACOPY22, 34% faster than ACOPY22 running under SPEEDUP and 31%
  94. faster than ACOPY22 while doing datestamping under ZSDOS.  See
  95. ACOPY30.HIS for more test information.
  96.  
  97.  
  98. Installation
  99. ------------
  100.  
  101. The distribution version of ACOPY is supplied with a Z3ENV
  102. address of 0000H, ready for use in ZCPR 3.3+ environments.  ZCPR
  103. 3.0 users should install ACOPY using their regular installation
  104. methods.
  105.  
  106. No installation is required for operation in non-ZCPR3
  107. environments.  However, several locations affecting program
  108. operation may be patched as described in the file ACOPY.PAT,
  109. although the default values should be satisfactory for most
  110. users.
  111.  
  112.  
  113. Syntax
  114. ------
  115.  
  116. ACOPY supports the use of both CP/M (destination=source) and MS-
  117. DOS (source destination) syntax.  The command line syntax is:
  118.  
  119.      ACOPY [dir:]source [[dir:]dest] [excluded] [/option(s)]
  120.   or ACOPY [[dir:]dest=][dir:]source [excluded] [/option(s)]
  121.  
  122. Both
  123.           A0>acopy filename.typ b11:
  124.       and A0>acopy b11:=filename.typ
  125.  
  126. will copy the file FILENAME.TYP from A0 to B11.
  127.  
  128. When only one filename is given, it assumed to be the source
  129. file, and will be copied to a destination file of the same name
  130. on the logged drive.  For example:
  131.  
  132.           B11:SAMPLE>acopy work:filename.ext
  133.  
  134. will copy the source file WORK:FILENAME.EXT to a file of the same
  135. name on B11:SAMPLE.
  136.  
  137.  
  138. Excluding Files
  139. ---------------
  140.  
  141. You may sometimes wish to copy a group of files specified by a
  142. filename/attribute mask which also includes some files you don't
  143. want copied.  You can optionally add a third filename mask to
  144. specify files that you wish to exclude from copying, even if they
  145. otherwise match the source file specification.  Note that if you
  146. choose to specify it, the exclusion filename must be the THIRD
  147. FILENAME specified.  The exclusion filename is a filename mask
  148. only, and any drive/user specified will be ignored.
  149.  
  150. In situations where you would normally only need to specify the
  151. source filename, and you also wish to specify an exclusion
  152. filename, you must provide at least a minimum destination file
  153. specification, such as the destination drive, user, or *.*, so
  154. that you have specified all three filenames in some way.  For
  155. example:
  156.  
  157.           A0:WORK>acopy util:filename.* a: *.doc
  158.  
  159. will copy the files UTIL:FILENAME.*, except for DOC files, to
  160. files of the same names on A0:WORK.
  161.  
  162.  
  163. Wildcards
  164. ---------
  165.  
  166. Source, destination and exclusion filenames may all contain
  167. wildcards.  Source and exclusion filename wildcards are expanded
  168. in the usual way.  ACOPY attempts to resolve destination file
  169. wildcards by a matching process.  For example:
  170.  
  171.           A0>acopy acopy.z80 b:??????30.*
  172.  
  173. will result in a destination filename of ACOPY30.Z80.
  174.  
  175. Since it is possible that this process may result in the creation
  176. of duplicate files, ACOPY stores the name of the last file copied
  177. and compares it to the name of the file currently being copied.
  178. If they match, ACOPY prints a 'Duplicate!' error message, and the
  179. current file is skipped.  If two files with the same names are
  180. not copied in sequence, a duplicate filename may still be
  181. created.  Care should be exercised in using destination file
  182. wildcards, but if you are careful and aware of the limitations of
  183. the process, you can do copying and renaming of multiple files in
  184. one step with minimal typing.
  185.  
  186.  
  187. File Attributes
  188. ---------------
  189.  
  190. New destination files will normally have the same filename
  191. attributes as the source files.  If a destination file overwrites
  192. an existing file of the same name, the new file will take on the
  193. attributes of the previous file.
  194.  
  195. Destination files will normally be marked as changed (not
  196. archived).  To help set up RAM disks, however, the 'D' option may
  197. be used to mark destination files as archived.  Source files may
  198. be archived after the files have been copied by using the 'S'
  199. option.  This helps you back up files and mark the sources as
  200. archived in one step.
  201.  
  202. Destination files are normally set as directory files.  The 'Y'
  203. option allows the option of copying files and setting them as
  204. system files in one step, a useful ability when loading RAM disk
  205. workspaces.  See the 'Options' section for more information.
  206.  
  207.  
  208. DOS Datestamping
  209. ----------------
  210.  
  211. When ACOPY detects that it is operating under CP/M 3.0, Z80DOS or
  212. ZSDOS, it takes advantage of the appropriate extended DOS calls
  213. to automatically copy the source file datestamps, if they exist,
  214. to the destination file datestamps so that destination files have
  215. the same creation and modification dates as the source files.
  216.  
  217. There is also an associated 'C' option that allows you to
  218. suppress datestamp copying, if desired, so that destination files
  219. are dated as newly created.  When operating under other DOS's,
  220. this option is not active and does not appear in the command line
  221. HELP message.  See the 'Options' section for more information.
  222.  
  223. When operating under ZSDOS, successful datestamping is indicated
  224. by displaying '(Dated)' in the copying status message.  No
  225. datestamping message will be displayed when datestamping support
  226. is not present, when there is a datestamping error, or when
  227. datestamping is done under Z80DOS.
  228.  
  229.  
  230. Destination Disk Free Space
  231. ---------------------------
  232.  
  233. ACOPY checks to make sure that enough free space for the
  234. destination file exists on the destination disk before attempting
  235. the copy.  If a file to be overwritten already exists on the
  236. destination disk, its size will be allowed for and it will not be
  237. deleted unless there will be in enough free space for the new
  238. file on the disk after the deletion.  If insufficient space
  239. exists, ACOPY will display a 'Disk too full!' message in the
  240. copying status message, the ZCPR3 program error flag will be set
  241. to 7 and the console bell will be sounded.
  242.  
  243. If a wildcard source filename was specified, ACOPY will continue
  244. to step through the list of source files, copying any files that
  245. will fit and giving error messages for each file that won't.
  246. Even if you use the 'O' or 'R' option to specify automatically
  247. overwriting existing files, no destination disk file will be
  248. deleted unless doing so will create enough space to allow copying
  249. of the replacement file.
  250.  
  251. If you are in the QUIET mode and attempt to copy a file to a disk
  252. that doesn't have enough free space,  ACOPY will cancel QUIET
  253. operation, as you will probably be interested in which files
  254. could be copied and which couldn't.  This will give you the
  255. information you need to take appropriate measures, such as
  256. changing disks and repeating the command, or erasing enough files
  257. on the destination disk to create enough free space for the files
  258. you still want to copy.
  259.  
  260. ACOPY can also help you 'pack' a backup disk.  It will look at
  261. each specified file, checking whether there is space for it on
  262. the destination disk, and copying it if there is.  It doesn't
  263. quit when it first finds insufficient space, but continues to
  264. look for files small enough to fit, and copys those that will.
  265. The ACOPY 'S' option (archive source files after copying) can
  266. mark as archived those files successfully copied, and you will be
  267. able to copy only the uncopied (and non-archived) files to
  268. another backup disk using the ACOPY 'N' option (copy only non-
  269. archived files).  A sample command line for backing up files is:
  270.  
  271.           A0>acopy *.* b: /nos
  272.  
  273. which will copy all non-archived (changed) files on A0: to B0:,
  274. automatically overwriting destination files of the same name and
  275. archiving the source files after copying.
  276.  
  277.  
  278. Options
  279. -------
  280.  
  281. ACOPY has a number of command line options, which must be
  282. preceded by the option flag character '/'.  The option letters or
  283. numbers may appear in any order and may appear anywhere in the
  284. command line.  Options may be combined in any combination.
  285. Options are toggled as they are read, so that an option appearing
  286. twice will cancel itself.  For example, all of the following
  287. command lines have the same meaning:
  288.  
  289.           A0>acopy /12qr source.ext dest.ext excluded.ft
  290.           A0>acopy source.ext dest.ext /1 /r excluded.ft /q /2
  291.           A0>acopy /12 dest.ext=source.ext excluded.ft /rq
  292.           A0>acopy /rq /q source.ext /q dest.ext /21 excluded.ft
  293.  
  294.  
  295. Individual options may be inactivated by setting the high bit of
  296. the option letter (adding 80H to the letter) or by just patching
  297. it to 80H or higher.  When an option is inactivated, it won't
  298. appear in the command line help message and it can't be selected.
  299. The 'A' and 'Y' options, for example, are normally inactivated,
  300. as most users won't require them.  An inactivated option may be
  301. reactivated by patching the option letter back to the capitalized
  302. option letter you have selected to specify the option.   Also, if
  303. you patch any option letter to 00H, ALL subsequent options will
  304. be inactivated.
  305.  
  306. The following descriptions of the options reflect the default
  307. option settings in the distribution version.  You may change the
  308. default option settings to suit your own needs by patching.  See
  309. ACOPY.PAT for more information.  The command line HELP screen
  310. will automatically display the proper selection message for each
  311. option based on whether it has been set to ON or OFF.
  312.  
  313. The options are:
  314.  
  315.      1 - 7 options.  Copies only those specified files which also
  316.           have the selected combination of the F1 through the F7
  317.           attributes set.
  318.  
  319.           Under Z80DOS and ZSDOS, where PUBLIC files have the F2
  320.           attribute set, you can also use the '2' option to
  321.           select only PUBLIC files for copying.  In this case,
  322.           the operating system will prevent you from creating
  323.           more than one PUBLIC file of the same name on a disk.
  324.           If you try copying a PUBLIC file to a different user
  325.           area, ACOPY will tell you that it already exists.  If
  326.           you try to overwrite the 'existing' file, the DOS  will
  327.           prevent it by aborting with a File W/P BDOS error.
  328.  
  329.      N - Copies only NON-archived (changed) files.  The source
  330.           file is archived after the copy is completed.  Under
  331.           ZRDOS, ZSDOS and other extended DOS's, the 'N' option
  332.           allows you to limit copying to non-archived files
  333.           (those files that have been opened or modified since
  334.           the archive attribute was set).  The destination files
  335.           are created as non-archived files unless the 'D' option
  336.           is selected to archive the destination files.
  337.  
  338.           Under CP/M 2.2, the archive attribute is not reset when
  339.           a file is updated, so this option is not too useful
  340.           unless you use a utility program to 'manually' set or
  341.           reset the archive attribute.
  342.  
  343.      A - Normally inactivated by making option letter 'A'+80h
  344.           (C1h) and set to ON to allow normally copying of both
  345.           directory and system files.  Option may be activated by
  346.           patching for users wanting to normally copy only
  347.           directory and not system files.  When enabled and set
  348.           to OFF, selecting the 'A' option allows copying of both
  349.           directory AND system files, otherwise only directory
  350.           files are copied.
  351.  
  352.      X - Skips copying if destination files of the same name
  353.           already exist, without asking.  Normally, you are asked
  354.           first.  Either the 'O' (Overwrite) or the 'R' (R/O)
  355.           option will override the skip option if both are
  356.           specified.
  357.  
  358.      O - Overwrites R/W destination files of the same name
  359.           without asking.  Normally, you are asked first.
  360.  
  361.      R - Overwrites R/O (or R/W) destination files of the same
  362.           name without asking.  Normally, you are asked first.
  363.  
  364.      M - Moves files.  Deletes the source files when the copying
  365.           operation has been successfully completed and displays
  366.           'Source Deleted' in the status message.
  367.  
  368.      Y - Normally disabled by making option letter 'Y'+80h (D9h).
  369.           Option may be enabled for users wanting to set
  370.           destination files as system files.  When enabled,
  371.           selecting the 'Y' option sets destination files as
  372.           system files, otherwise sets destination files as
  373.           directory files.
  374.  
  375.      C - Controls whether the source file datestamps will be
  376.           copied to the destination file datestamps when
  377.           operating under Z80DOS or ZSDOS (default is to copy
  378.           datestamps).  When operating under other DOS's, this
  379.           option is inactive and will not appear in the command
  380.           line HELP message.
  381.  
  382.           If datestamps are copied, the destination files will
  383.           have the same creation and modification dates as the
  384.           source files.  If datestamp copying is suppressed,
  385.           destination files will be dated as newly created.
  386.  
  387.      D - Sets the archive attributes in the destination files,
  388.           marking them as archived.  Speeds copying to RAM disks
  389.           by copying and marking the copies as archived in the
  390.           same operation.  No message is displayed in the status
  391.           line.
  392.  
  393.      S - Sets the archive attributes in the source files after
  394.           copying, marking them as archived and displays 'Source
  395.           Archived' in the status message.
  396.  
  397.      V - Turns CRC verification off (default is to always verify
  398.           copies.)  May be patched so that verification is
  399.           normally off, in which case the 'V' option turns it on.
  400.  
  401.      Q - Quiet.  Usually used in alias environments, the 'Q'
  402.           option turns off non-error status messages.  Any
  403.           information you should know about during the copying
  404.           process, such as error information, is still displayed.
  405.           No existing files will be overwritten unless the 'O' or
  406.           'R' options are also used.  If you attempt to copy a
  407.           file to a disk which doesn't have enough free space
  408.           while in the QUIET mode, ACOPY will cancel QUIET
  409.           operation so that you can view subsequent status
  410.           information.
  411.  
  412.           When operating in a ZCPR3 environment, the 'Q' option
  413.           state will automatically be set according to the state
  414.           of the ZCPR3 QUIET flag, no matter how the default
  415.           option setting is patched.
  416.  
  417.  
  418. ZCPR3 Program Error Flag
  419. ------------------------
  420.  
  421. ACOPY sets the ZCPR3 program error flag, if it exists, when an
  422. error occurs during program operation.  For more flexible use in
  423. alias and ZEX scripts, ACOPY follows the convention set by Rick
  424. Charnes by setting the error flag to the following values for the
  425. indicated error conditions:
  426.  
  427.      7 = Destination disk too full to copy the current file
  428.      8 = User abort
  429.      9 = Destination disk directory full
  430.   0FFH = Fatal error (which will terminate ACOPY operation)
  431.  
  432.  
  433. Optional ACOPY Modifications
  434. ----------------------------
  435.  
  436. ACOPY has a number of locations near the beginning of the program
  437. that can be patched using DDT, PATCH, ZPATCH, etc, to alter the
  438. operation of the program to suit the user.  See ACOPY.PAT for
  439. further information.  ACOPY.PAT may also be assembled to an
  440. overlay file and overlaid on ACOPY30.COM to create a custom copy
  441. of ACOPY.COM.
  442.  
  443.  
  444. ACOPY in Alias Scripts
  445. ----------------------
  446.  
  447. When a ZCPR3 alias script is used to copy a large number of files
  448. with unrelated filenames, the command line may quickly become
  449. longer than the command line buffer.  F1-F7 filename attribute
  450. tagging helps group the files by the desired function, allowing
  451. shorter and faster alias scripts.
  452.  
  453. Specifying files to be copied by both filename masks and
  454. attributes can be useful, for example, when copying files from a
  455. disk containing a large number of software development utilities
  456. to a RAM disk.  An alias script can be written to copy only those
  457. files necessary for 8080 assembly language work, and another
  458. alias script written to copy only those necessary for Z80
  459. assembly language work.
  460.  
  461. The source files may be tagged so that several single copy
  462. aliases will copy different subsets of the same group of source
  463. files.  For example, all 8080 development files might have the F2
  464. attribute set, all Z80 development files might have the F3
  465. attribute set, all the necessary text processing files might have
  466. the F4 attribute set, and all desired general utility files might
  467. have the F5 attribute set.  You can then copy a complete 8080
  468. work utility file set from drive F0: to drive A0:, skipping those
  469. files where the destination files already exist, and mark the
  470. destination files as archived, with the script:
  471.  
  472.           A0>acopy f:*.* /245xd
  473.  
  474. and a complete Z80 work utility file set, except for .DOC files,
  475. may then be similarly copied and archived with the script:
  476.  
  477.           A0>acopy f:*.* a: *.doc /345xd
  478.  
  479.  
  480. Acknowledgements
  481. ----------------
  482.  
  483. ACOPY was developed to suit my own special needs based on David
  484. Jewett, III's well-written and documented PPIP12, a very nice
  485. piece of work!  PPIP has been further updated by Jay Sage and
  486. others to support Z-system and datestamping operation.  I refer
  487. interested users to the latest version of PPIP for further
  488. information.
  489.  
  490. The disk directory buffering scheme used in ACOPY30 is adapted
  491. from the core code of Hal Bower's great SPEEDUP disk directory
  492. buffer RSX contained in SPEEDUP.LBR.  The operation of SPEEDUP is
  493. described in Hal's LINKPRL article in The Computer Journal, issue
  494. #41.
  495.  
  496. And special thanks, also, to all you ACOPY users whose
  497. suggestions, comments and bug reports and testing contributions
  498. have been very helpful!
  499.