home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / dirutl / dir1st31.lbr / DIRFIRST.DQC / DIRFIRST.DOC
Text File  |  1986-04-18  |  9KB  |  170 lines

  1. DIRFIRST:                    (General description and operation.)
  2.      Z-80 sorted directory showing of first line(s) of files.  
  3.  
  4. This file documents version 3.1, written February 28, 1986.
  5. Copyright 1986 by Bob Abrahams, released for non-commercial use 
  6. at no cost.  May not be sold.  All other rights reserved.  
  7. Messages for the author can be left on Kim Levitt's Micro-BBS 
  8. system in Hollywood, CA (213-653-6398) or on Abel Iwaz's 
  9. Literaria BBS in Glendale, CA (818-956-6164).
  10.   
  11. NOTE:  This version is written using Z-80 instructions, so it 
  12. should be run on Z-80 CPU systems only.
  13.  
  14. This program lists a sorted disk directory (with file sizes) that 
  15. also shows the first line(s) of each file (if printable).  This 
  16. feature can be used to provide additional information on files 
  17. beyond the name of the file alone.  This is intended primarily 
  18. for text files, but other file types can be displayed.  The user 
  19. must put the additional description or other information on the 
  20. first line(s) of the file, with less than 80 characters in each 
  21. line.  The display of each line will stop at any carriage return.  
  22. If file is to be used by WordStar, the line(s) can be set up as a 
  23. "comment" line by starting the line with two periods.  Any blank 
  24. lines are skipped, including lines with blanks and tabs only.
  25.  
  26. The contents of some files (those with certain extensions, such 
  27. as .COM and .OVR) will not be displayed (unless the $A option is 
  28. used).  In any case, in displaying the contents line of the file, 
  29. control characters are suppressed, and each line stops at the 
  30. first carriage return or at the end of the first console line* so 
  31. that "unprintable" files do not wreak havoc even if displayed.  
  32.   * In this version, console width is assumed to be 80 chars.
  33.  
  34. Squeezed files (with file type ?Q?) of the standard type squeezed 
  35. by the various public domain CP/M squeezing programs are 
  36. unsqueezed, unless the program is modified as listed below, or 
  37. unless the original file is of an "unprintable" type.  Whether or 
  38. not the unsqueezing is done, the squeezed and original file names 
  39. are still listed, even if of an "unprintable" type.  The check 
  40. for file type can be skipped by uising the appropriate options.
  41.  
  42. It is suggested that the user change the name of the program to 
  43. D1.COM for easier use.  D1 is called similar to DIR -- that is, 
  44.               D1 {<afn>} {$<options>}
  45. As with DIR, the <afn> parameter can be any file specification, 
  46. ambiguous (containing wildcard characters * and/or ?) or 
  47. unambiguous, including an optional drive specification.  Only 
  48. standard CP/M drive specifications are permitted (e.g. B:).  This 
  49. version is NOT set up to use ZCPR-type drive/user specifications, 
  50. such as B1:<filename>.   
  51.  
  52. Options are indicated with a dollar sign ($) followed by the 
  53. requested option code(s).  Spaces may not be embedded between the 
  54. dollar sign and the option codes.  As created, the defaults for 
  55. most options is OFF.  Default for options $L (Libraries) and $X 
  56. (eXclude types) is ON.  See below for information on patching for 
  57. other defaults.
  58.  
  59. In this version, the options are:
  60.  
  61. A:  display contents of All files.  (Otherwise supress the           
  62.      display of the contents of files with some types:  .COM,           
  63.      .OBJ, .SYS, .OVR, etc.)  When listed types are supressed, a 
  64.      squeezed file whose original name is on the "unprintable" 
  65.      list will not be unsqueezed and displayed.
  66. S:  include SYS attribute files.  Normally these files are 
  67.      supressed from the listing.
  68. X:  eXclude files on the "bad" type list altogether.  (Not even 
  69.      listed in the directory.)  This does not exclude squeezed 
  70.      files by their original name, though this can be done by 
  71.      including ?Q? to the type table (see patching procedure 
  72.      below), which will exclude all files with type ?Q?, whether 
  73.      truely squeezed or not.  Overrides the $A option.  Default 
  74.      for this option is ON.   
  75. L:  open Library files (type .LBR), list member names and sizes      
  76.      and display the contents of each member, following the 
  77.      same rules as under option A with regard to files not 
  78.      displayed.  (With no $L, option, files with type .LBR are           
  79.      not displayed, unless option A is used.)  Library members 
  80.      are shown in order in library directory (sorted only if 
  81.      created by library utility that sorts its directory.)  
  82.      Default for this option is ON.
  83. K:  show file sizes in 1K increments.  Normally file sizes are 
  84.      shown in disk block increments.  (This has no real effect if 
  85.      the drive referenced has 1K blocks.)  Library member sizes 
  86.      are always shown in 1K increments.
  87. N:  No paging.  Do not stop at the end of each screen.*  (May be 
  88.      used with CP/M ^P echo feature to print output on list 
  89.      device.)  Normally, the display stops at the end of each 
  90.      screen with the message "More...".  The program then waits 
  91.      for any key to be pressed.  At this point (or at almost any 
  92.      other point in the execution), pressing ^C will abort the 
  93.      program execution.  
  94.   * In this version, screen height is assumed to be 24 lines.
  95. 1-9: List this number of lines from each file.  Default is 
  96.      normally 1 line (thus DIRFIRST).  With 1 line requested, no 
  97.      page break will occur between the file or member name and 
  98.      the first line of that file.  With more than one line 
  99.      selected, a page break may occur in the middle of the file 
  100.      display.  (Obviously this does not apply if the $N option is 
  101.      ON and there is no paging.)  If more lines are requested 
  102.      than are in the file, an extra blank line may be shown at 
  103.      the end of the display for that file.
  104.  
  105. All options used are listed on the command line together 
  106. following a dollar sign.  For example, to list files on drive B:, 
  107. opening Libraries, displaying contents of All files, and 
  108. including SYS files, use the command  D1 B: $LAS.  Option codes 
  109. may be listed in any order.
  110.  
  111. Program operation may be aborted at any time by pressing ^C 
  112. (Control and C keys together.)  On some system, this entry is 
  113. blocked during disk reads.  Those with buffered keyboard entries 
  114. will not have this restriction.
  115.  
  116. -----------------------------------------------------
  117.  
  118. Making modifications to .COM file (patching):  
  119. (Use DDT, SID or other file patcher to make modifications.)
  120.  
  121. 1) The list of files that cannot be displayed (except under A
  122. option) is located near the beginning of the program, following 
  123. the sign-on message.  This is a table in which each entry has 
  124. three characters, each representing an unprintable file type.  
  125. The character following the last entry must be a 00 byte to 
  126. terminate the scan.  The ? character can be used to represent any 
  127. character (wildcard).  (The * wildcard cannot be used.)  An entry 
  128. starting with a period (.xx) may be used to hold a space to be 
  129. skipped, since there can never be a type starting with a period.
  130.  
  131. 2) Library files (type .LBR) are checked against a string 
  132. following the above table.  This string is 4 bytes long, 
  133. consisting of the letters LBR and terminating with a 00 byte.   
  134. If .LBR files are not to be checked as Libraries, then patch out 
  135. the character L with a 00 byte to terminate the comparison.
  136.  
  137. 3) Immediately following the 00 byte terminating the LBR string 
  138. above is a table used to check for and set options.  Each entry 
  139. in this table consists of the option letter and a byte used to 
  140. store the status of the option.  A value of zero sets the option 
  141. off.  The last entry is followed by a 00 byte terminator.  To set 
  142. the option default on, set the 0 byte for that option to non-
  143. zero.  With the default set on, using the option letter in the 
  144. option group on the command line (following the $) then sets the 
  145. option off.  (Actually, each use of the option represents a 
  146. toggle.  Normally, using any option twice leaves the option off.)
  147.  
  148. 4) Following the above table, is the character "#" followed by a 
  149. byte with the value 01.  This second byte is the default value of 
  150. the number of lines to be printed.  It can be set for any value 
  151. from 1 to 9.  DO NOT SET THIS VALUE TO 00.  (It is recommended 
  152. not to use a value over 9.)
  153.  
  154. 5) The program includes an unsqueezing section which pushes the 
  155. total size of the .COM file over 2K.  If no unsqueezing is to be 
  156. done (perhaps because no squeezed files are included) and the 
  157. user wants the file to be within 2K, the unsqueezer can be 
  158. deactivated and removed.  To do this, use DDT or SID as follows:  
  159. load the program into memory using DDT or SID.  If using SID, 
  160. start with the CP/M command SID D1.  Then use the SID command 
  161. W<new>.COM,0100,08FF, then exit with the SID command G0.  If 
  162. using DDT (on CP/M 2.2), start with the CP/M command DDT D1.COM, 
  163. then immediately exit DDT with the G0 command, then use the CP/M 
  164. command SAVE 8 <new>.COM.  With CP/M 2.2, use SID or DDT to be 
  165. sure to SAVE an initialized version of the program.  With CP/M 
  166. 3.0, only use SID, with its W command.  In both cases <new> is 
  167. the new temporary name of the program.  It may be renamed to 
  168. D1.COM after testing.  The file D1/NOUSQ.COM has been prepared in 
  169. this way.
  170.