home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / BEEHIVE / ZSUS / ZSUS009.LBR / DSKNUM14.LBR / DSKNUM14.DZC / DSKNUM14.DOC
Text File  |  1990-07-28  |  13KB  |  279 lines

  1.  
  2.                              DSKNUM
  3.                            Version 1.4
  4.  
  5.                           Gene Pizzetta
  6.                           July 29, 1989
  7.  
  8.  
  9. DSKNUM creates consecutively numbered disk labels (null files) 
  10. for use by the most popular disk cataloging programs, such as 
  11. MCAT, NCAT, and FATCAT.  The last number used is normally stored 
  12. internally so you don't have to remember where you left off.  
  13. ZCPR 3.3 or higher, which includes NZCOM and Z3PLUS, is required.
  14.  
  15. USAGE:
  16.  
  17.      DSKNUM {dir:}{label}{.num} {{/}options}
  18.  
  19. If no DIR or DU specification is given, the current drive and/or 
  20. user is assumed, unless an internal default user has been 
  21. installed, in which case the given user specification will be 
  22. ignored.
  23.  
  24. If no label name is given, an internal default is used.  The 
  25. label tag character need not be included.  If the given name is 
  26. longer than seven characters, only the first seven will be used.
  27.  
  28. If no disk number is given, the the next number after the 
  29. internally stored one is used.
  30.  
  31. If no option is given, DSKNUM labels a single disk, saves the 
  32. number used, and exits.
  33.  
  34. OPTIONS:  A leading slash is not required unless no other 
  35. parameters are given on the command line.
  36.  
  37.      M    Multiple label mode.  DSKNUM prompts for a key-press
  38.           before each label is written to disk.  If ESC is
  39.           pressed, the last number used will be saved, and
  40.           DSKNUM will exit.  A ^C will abort the program
  41.           immediately and the internal number will remain as it
  42.           was before the session began.
  43.  
  44.      S    Do not save last disk number.  Used with or without the
  45.           M option, the internally stored number will remain
  46.           unchanged.
  47.  
  48. The target drive will be reset (for safety) before writing each 
  49. disk label under ZSDOS and CP/M-3 (Z3PLUS); otherwise, the entire 
  50. disk system will be reset.  Whether a reset is done before saving 
  51. the last number used is a configuration option (see below).
  52.  
  53. The last used label number is saved internally in a very simple 
  54. way.  It is stored as a two-byte word in the first record of the 
  55. program in memory.  At each exit that record is written back to 
  56. the program's COM file on disk.  On initial invocation DSKNUM 
  57. gets its current name and the DU where it is located from the 
  58. ZCPR external file control block.  That data is stored in memory 
  59. so that if DSKNUM is invoked again with the GO or JUMP command, 
  60. it won't think its name is "GO" or "JUMP".
  61.  
  62. DISK LABELS:  DSKNUM creates consecutively numbered disk labels 
  63. compatible with commonly used disk cataloging programs, such 
  64. FATCAT, MCAT, and NCAT.  These labels are null (0k) files with a 
  65. three-digit number in the filetype.  As distributed, DSKNUM 
  66. starts with number "001".  FATCAT does not allow a disk number of 
  67. "000".  Of course, you can start with any number by entering that 
  68. number on the command line.  DSKNUM will store the number and 
  69. increment it from there.
  70.  
  71. The name part of the label may be almost anything, but the first 
  72. character must be a special "tag" character that makes the label 
  73. unique.  FATCAT, in addition, requires that the label come first 
  74. (excluding a !!!TIME&.DAT file) after the filenames on the disk 
  75. are sorted.  Thus the tag character should be one that is early 
  76. in the ASCII order and that is not used by other files.  Here are 
  77. the possibilities:
  78.  
  79.      !    Earliest legal character in ASCII order, but a label
  80.           with this character cannot be manipulated by the CCP
  81.           under CP/M-Plus.
  82.  
  83.      #    Earliest legal character with no known limitations.
  84.  
  85.      $    Commonly used by temporary files, particularly by SUB
  86.           and SUBMIT.
  87.  
  88.      %    Used as leading filename character by CP/M MUMPS.
  89.  
  90.      &    No known limitations.
  91.  
  92.      +    No known limitations.
  93.  
  94.      -    Probably most commonly used tag character, but it is
  95.           also used by many other files, such as -READ.ME,
  96.           SIG/M's -CATALOG.nnn, etc.
  97.  
  98.      /    No known limitations, but it's getting late in the
  99.           ASCII order.  There is also a CP/M program named "/".
  100.  
  101. I strongly recommend that you use "!" or "#" as your tag 
  102. character because they are the earliest in ASCII order and they 
  103. are used by few other filenames.  Do not use the hyphen ("-").  
  104. It is used by too many other files and it is late in the ASCII 
  105. order.
  106.  
  107. DSKNUM will not let you write a label to a disk that already 
  108. contains a filename beginning with the tag character.  Thus you 
  109. are protected from forgetting to change disks when using the M 
  110. option and from confusing your cataloging program.  The tag 
  111. character is the distributed version is "#", but that can be 
  112. changed (see below).
  113.  
  114. SINGLE-DRIVE OPERATION:  If you have a single floppy disk drive 
  115. and you want to load DSKNUM from disk, you should have no 
  116. problem.
  117.  
  118. Use the M (multiple label) option on the command line and then, 
  119. while DSKNUM is running you can change disks freely.  When you 
  120. press ESC to quit the program, DSKNUM will look at the drive for 
  121. its COM file and, if it doesn't find it, will prompt for the 
  122. program disk.
  123.  
  124. If this mode of operation is to be used, you should configure 
  125. DSKNUM to reset the drive before saving the last number (see 
  126. below).
  127.  
  128. ERRORS:  If an error occurs, DSKNUM will exit with an error 
  129. message in most cases.  Under the M option, however, a full 
  130. directory or an existing label will merely cause DSKNUM to prompt 
  131. again for a disk.
  132.  
  133. All errors will set the ZCPR3 error flag to the following values:
  134.      2    Invalid DU or DIR given on the command line
  135.      9    Invalid number given or number exceeds 999
  136.     11    Out of directory space
  137.     16    Label already exists on target disk
  138.     19    Invalid option given
  139.      4    User aborted (^C) or file write error
  140.  
  141. In multiple label mode (M option), where errors 11 and 16 do not 
  142. cause the program to exit, the error flag will set according to 
  143. the most recent error encountered.
  144.  
  145. CONFIGURATION:  The various configuration options discussed below 
  146. can be easily set using ZCNFG (version 1.6 or later) with the 
  147. included configuration file (DSKNUMnn.CFG).  Do not change the 
  148. name of the configuration file.  The configuration filename is 
  149. held internally in DSKNUM.COM so that ZCNFG can find it even if 
  150. you rename DSKNUM to something else.  For instance, I maintain a 
  151. second version version of DSKNUM, called LBRNUM, that I use to 
  152. label my archival library disks.  The DSKNUMnn.CFG file is found 
  153. automatically by ZCNFG for LBRNUM too.
  154.  
  155. As an alternate, the COM file can be patched with any patching 
  156. tool, if that's what you prefer.  The configuration bytes are 
  157. preceded by ASCII labels ending with a ">".
  158.  
  159. Following is a discussion of each configuration item identified 
  160. by both the ZCNFG menu selection number and by the ASCII label in 
  161. the COM file:
  162.  
  163.      1    ROFLG>    If set to a non-zero value, the disk label
  164.                     will have its read/only attribute set so the
  165.                     label cannot be accidentally erased.  This
  166.                     is recommended.  As distributed: OFF.
  167.  
  168.      2    SYSFLG>   If set to a non-zero value, the disk label
  169.                     will have its system attribute set so that
  170.                     the label will not appear in ordinary disk
  171.                     directories.  As distributed: OFF.
  172.  
  173.      3    ARCFLG>   If set to a non-zero value, the disk label
  174.                     will have its archive attribute set so that
  175.                     the label will not be copied to another disk
  176.                     during an archival backup.  As distributed:
  177.                     OFF.
  178.  
  179.      4    RSTFLG>   If set to a non-zero value, the drive or
  180.                     drive system will be reset before DSKNUM
  181.                     tries to save the last number used into
  182.                     itself.  If you run DSKNUM from a hard disk,
  183.                     a reset is unnecessary and will slow things
  184.                     down slightly.  If DSKNUM is loaded from a
  185.                     floppy, it's a good idea to activate this
  186.                     reset.  As distributed: OFF.
  187.  
  188.      5    LBLTAG>   Tag character used as the first character
  189.                     of each label name.  The tag character must
  190.                     not be the first character of any other file
  191.                     on the disk.  "!" or "#" is recommended (see
  192.                     discussion of disk labels above).  As
  193.                     distributed: "#".
  194.  
  195.      6    DFTLBL>   This is the default label name to be used if
  196.                     no label name is given on the command line.
  197.                     A maximum of seven characters is allowed.  If
  198.                     less than seven characters is used, the rest
  199.                     must be padded with spaces (this is done
  200.                     automatically by ZCNFG).  Do not include the
  201.                     tag character.  As distributed: "DISK".
  202.  
  203.      7    LBLUSR>   If you always want your labels in the same
  204.                     user area, you can set that here (0-31).
  205.                     All labels will then be created in that user
  206.                     and any user given on the command line will
  207.                     be ignored.  This configuration option also
  208.                     allows labels to be created in users beyond
  209.                     the maximum set in the environment, which is
  210.                     not possible from the command line.  If this
  211.                     configuration byte is set to value greater
  212.                     than 31 (decimal), DSKNUM will create the
  213.                     label in the user given on the command line
  214.                     or, if none is given, in the current user.
  215.                     Since cataloging programs only allow one
  216.                     label per disk, setting this byte to your
  217.                     preferred user area is highly recommended.
  218.                     As distributed: FFh (use command line).
  219.  
  220. HISTORY:  The idea for DSKNUM came from a similar program, 
  221. VOLNUM, which ran only from drive A and then only if A was the 
  222. default drive.  The target disk had to be on drive B, which for 
  223. many of us is a hard drive.  Nevertheless, VOLNUM internally 
  224. saved the last number used.  I never used the program because of 
  225. the above and other problems, which I couldn't correct because 
  226. the source code was not released.  But I thought the idea was 
  227. good, so I decided to write my own.
  228.  
  229. Version 1.0 -- December 24, 1987 -- Gene Pizzetta
  230.      First version for CP/M-Plus, named DISKNUM.  Finds itself by
  231.      detecting which drive it was loaded from (which is possible
  232.      under CP/M-Plus), but runs only from the current user area.
  233.  
  234. Version 1.1 -- December 26, 1987 -- Gene Pizzetta
  235.      Without a CP/M 2.2 machine to test it on, I tried to add 2.2
  236.      CP/M 2.2 support.
  237.  
  238. Version 1.2 -- February 28, 1989 -- Gene Pizzetta
  239.      Rewritten for CP/M 2.2 after discovering version 1.1 didn't
  240.      work!  Added user area support.  Must be configured to find
  241.      itself in a specific DU.  Runs on all CP/M and compatible
  242.      machines.
  243.  
  244. Version 1.3 -- March 3, 1989 -- Gene Pizzetta
  245.      Minor bug correction.
  246.  
  247. Version 1.4 -- July 28, 1990 -- Gene Pizzetta
  248.      Complete rewrite.  Requires ZCPR 3.3 or higher.  Name
  249.      changed to DSKNUM from DISKNUM.  Labels a single disk from
  250.      command line.  Still labels multiple disks interactively.
  251.      Accepts label name from command line in lieu of internal
  252.      default label name.  Accepts disk number from command line
  253.      in lieu of internal stored number.  Label attributes
  254.      configurable.  Gets its own filename and directory location
  255.      from external file control block on first invocation.  Name
  256.      is stored for subsequent execution with GO command.  Has
  257.      type 3 header.  Resets only target disk instead of entire
  258.      disk system under Z3PLUS and ZSDOS.  Configurable to reset
  259.      disk or not when saving last number internally (resets not
  260.      needed for hard drives).  Accepts target user area from
  261.      command line or configurable to use internal default user.
  262.      Aborts if label already exists on disk.  ^C aborts to
  263.      operating system at any prompt.  Brief usage screen if "//"
  264.      is given.  Configurable with ZCNFG 1.6 or higher.
  265.  
  266. Formatting and labelling disks is a real chore.  I hope this 
  267. makes life a bit easier for somebody besides myself.  Let me know 
  268. if there are any problems.
  269.  
  270.      Gene Pizzetta
  271.      481 Revere Street
  272.      Revere, MA  02151
  273.  
  274.      Voice:  (617) 284-0891
  275.      Newton Centre Z-Node:  (617) 965-7259
  276.      GEnie:  E.Pizzetta
  277.  
  278. Developed with SLRMAC and SLRNK+.
  279.