;
                                 LDIR-B.COM                                   

             Size (recs) CRC   Version    Author/Latest Issue      Disk
               2k (16)   A343  2.2        Bruce Morgen 9/91        Z3COM5

  1- Syntax/Usage  2- Configuration  3- Notes  4- Example of Usage            


   LDIR-B.COM is a 'Library Directory' program which provides much more useful
information than the  original  LDIR.COM.  It  automatically  displays  member 
files along with their create and modify dates, sizes, compression method, and
their uncompressed filenames.  LDIR-B also displays datestamps for the library
itself.  A summary line gives the total number of member files found.

   LDIR-B will run under vanilla  CP/M 2.2 and CP/M Plus,  but  offers several
enhancements when run under ZCPR3.  
:1
 Syntax   LDIR {dir}lbrname {afn.typ}

   A DIR (named directory) or DU  (drive/user) specification is accepted under
ZCPR3.   Under vanilla CP/M only the drive is significant.   If  an  ambiguous
file specification is given following the  library name,  only matching member
files will be shown.   If no member file  specification is  given,  all member
files will be shown.

   A final summary line shows the number of matching  member  files found.  If
the wheel byte is  set,  the  summary also shows the number of active files in
the library,  the number of  deleted  files,  the  number  of  free  directory
entries, and the total directory entries.

   If a crunched file contains an embedded comment, it will be displayed up to
18 characters.   Otherwise, the  uncrunched  or  unsqueezed  filename  will be
shown.

   The length of member files is shown in records (sectors) and in  kilobytes,
including  fractional parts of a kilobyte  (.00, .12, .25, .37, .50, .62, .75,
or .87, indicating 0 to 7 additional records.
 Syntax/Usage - 2/2 

   If no dates are found in the library directory,  crunched files are checked
to see if they  contain  embedded  datestamps.   If  so,  they  are  displayed 
instead.

   LDIRB pauses with a  "[more]"  prompt after each  screenful until a  key is
pressed.   Entering  ^K,  K,  k,  ^X, X, x,  ^C, C, or c  anytime  aborts  the
program.  Except at the "[more]" prompt, a ^S pauses the display until another
key is pressed.  Typing a space at any time sets the line counter to one for a
"line by line" advance.

   For additional system security,  LBR files with the  SYS attribute set will
be ignored if the wheel byte is reset.

   Under ZCPR3 the program error flag is  set  to  FFh  if  no matching member
files are  found,  to  10 if the  library  file  is not  found, or to 4 if the
library is corrupt.
:2
 Configuration 

   LDIRB should be ready to use  "as is"  with no  configuration necessary for
either RCP/M systems or individual use.   There are three configuration bytes,
however, that may be changed if necessary .

   Setting the byte at 10Bh to a non-zero value will force  LDIRB to warm boot
on exit.

   Under ZCPR3 the number of screen  lines  and  the  wheel  byte  address are
obtained from the  environment  descriptor.   On  other  systems the number of
screen lines can be set at 10Ch.   The default is 22.   The wheel byte address
can also be installed at 10Dh-10Eh  (low byte first).   The default address is
3Eh.
:3
 LDIR-B Notes - 1/6 

   a. Vs 2.2 updates (9/10/91, Bruce Morgen):
      - Repaired two  minor  display  flaws.   When listing  a library with an
        internal modify date (but no internal create date) and a  member wild-
        card token, v2.10 and earlier left no space between the closing paren-
        thesis of the member wildcard display and the word "Modify" (previous-
        ly "Mod"); this is now fixed.   A single one-byte instruction has been
        added to assure that the initial LDIRB header does not  scroll off the
        screen when listing large libraries' contents.

   b. Vs 2.1 updates (9/5/91, Gene Pizzetta):
      - Added divider line before  summary  line  (looks more like UNARC which
        was Steven's intent).  
      - Summary consolidated to single line  (was able to coax variable length 
        numbers out of DECOUT with a little extra code).  
      - Changed "Cre date" and "Mod date" to "Created" and "Modified".  
      - Created new documentation file and moved history to separate file.
      - Crunched the code some more, so it's a few bytes shorter!
      - Known bug:  Libraries with more than  999  members  will  likely cause
        the summary line to wrap, but he who does it, deserves it!
 LDIR-B Notes - 2/6 
 
   c. Vs 2.0 updates (8/20/91, Bruce Morgen):
      - Control character filter on all CRUNCH/LZH comment strings.
      - Summary line shown even if there are no matching files.  
      - LBR file name shown on summary line (a boon when listing big LBRs!).  

   d. Vs 1.9 updates (8/15/91, Bruce Morgen):  /unreleased/
      - Introduced a summary of LBR directory statistics. 
      - Did some fairly severe code crunching to keep the program at 2K.
      - Ran across and repaired a bug that had not surfaced previously because
        a referenced defined space is now  above the  COMfile image instead of
        in it.   The value at  OFFSET  is now written and read as a byte,  not
        written as a byte and read as a word,  which was a tince longer/slower
        anyway!  
      - Fixed long  standing  cosmetic  problem  with  internally  dated  LBRs
        combined with member wildcard specification at the command line.

   e. Vs 1.8 updates (2/24/91, Gene Pizzetta)
      - Now gives correct number of  matching  members  when  used with the GO
        command.
 LDIR-B Notes - 3/6 

   f. Vs 1.7 updates (2/17/91, Gene Pizzetta)
      - CR23D does not reset high bits when crunching files.   Those high bits
        are now reset in the display.
      - A summary line is now  printed  giving  the  number of matching member
        files found.  
      - A version (VERS) equate was  added at  the  beginning of this file and
        the  version  date was  removed  from the  usage  screen to facilitate
        version updates.
      - Blank lines were removed from the displays to make them more compact.
      - The syntax line under ZCPR3 now shows  "dir:"  instead of "du:", which
        is correct.
      - Under ZCPR3 the  program  error  flag is now set if no matching member
        files are found (FFh),  if the library  file is not found (10),  or if
        the library is corrupt (4).

   g. Vs 1.6 updates (1 Jul 90, Howard Goldstein):
      - Fixed problems associated with zero-lengthh member files.  The program
        was attempting to read the first record of each member file.   Not too
        cool if the member file is empty!
 LDIR-B Notes - 4/6 
 
      - Modified to display original file name on squeezed as well as crunched
        files.
      - Corrected usage message.
      - Removed all old commented-out code; shortened code in a few places.
      - Modified the code that reads the  LBR directory into memory to exclude
        each member's CRC.  This gets us down to 19 bytes per entry again.
      
   h. Vs 1.5 updates (9/19/89, Sean N. Sullivan):
      - added capability to recognize files compressed by CRLZH
      - if file is not compressed, LDIR listing now says that it is "Stored"
      - help display changed to look more like a ZCPR3 help display
      - minor change to listing heading (HEDING:)
   
   i. Vs 1.4 updates (7/1/88, Michal Carson):
      - added display of datestamps for library itself
      - corrected bug with  interpretation of crunched-file  datestamp headers
      - now downcases letters of a filename which have high bits set
      - extchr replaced by crflag which will return 0ffh if file is crunched
      - changed method of determining a  file's compression.   First sector of
        each file is now read and the  first two  bytes  examined for crunched
        or squeezed headers
 LDIR-B Notes - 5/6 

   j. Vs 1.3 updates (5/28/88, Michal Carson):
      - added support for modification date
      - eliminated CRC in display
      - LINLEN reduced to 19

   k. Vs 1.1 updates (11/5/87, Bruce Morgen): 
      - Added minimalist ZCPR3 support.  If the program is installed via Z3INS
        or Z-RIP (or auto-installed at run-time by ZCPR 3.3+ or by BGii 1.13+)
        LDIR-B will get the wheel byte  address and CRT length from the  ZCPR3
        environment and will log into the user area parsed into DFCB+13 by the
        CPR.   This revision necessarily  moves the  configuration bytes up by
        eight bytes; it also uses the extra byte at "SPARE:" as the MSB of the
        wheel byte address and no longer  assumes  that  the  wheel byte is on
        page 0  (commercial ZCPR3 implementations tend to follow the  "Echelon
        Standard" memory map, established by Joe Wright,  which puts the wheel
        byte up at FDFFh).  
      - LDIR-B now  displays  filesizes in  records  as  well  as kbytes.  The
        record count is more  easily  related to the  file  transfer  progress
        displays of IMP/MEX.
 LDIR-b Notes - 6/6 

      - Reduced "LINLEN" to 21 and revised "HEDING:"  format to accomodate the
        record count inclusion.  
      - Fixed bug  handling  LBRs  with  no  member files, same code handles a
        no-match situation with the user-supplied wildcard.
      - Now accepts the second token on the incoming command line as  optional
        wildcard filespec for selecting the library member files to be  shown.
        If present,  this selection is displayed  following the library's name
        in the "( --> filename.typ)" format.   1023-member restriction is also
        removed by using a 16-bit value at "DIRLEN:" and adding a little extra
        code to handle the bigger numbers.  

   l. Vs B updates (10/17/87, Steven Greenberg):
      - For additional  system  security,  will  ignore .LBR  files  with  SYS
        attribute set, if wheel byte is zero.  
      - Wheel byte location is defined by byte at 105h and defaults to 3Eh.  
      - Checks for console chars:  ^K,K,k ^X,X,x, ^C,C,c - abort; ^S - pause.
      - New line counter issues "[more]" prompt after 22 lines (byte at 104h).
      - Typing a space at any time sets line counter to one for "line by line"
        advance.
      - LUXX77A revised to LUX77B by Irv Hoff now  includes (and automatically
        supports) this program.
:4
 Example of Use 

   a. B0:WORK>ldir ldirb22<cr>

Library: LDIRB22 .LBR                    Created 10 Sep 91  Modified 10 Sep 91  
   Name           Length     Method    Created   Modified       Comments
============   ====-======= ========  =========  =========  ==================
LDIRB21 .DZC    14r   1.75k Crunched  19 Sep 89  07 Sep 91  (-> LDIRB21.DOC)
LDIRB22 .COM    16r   2.00k  Stored   10 Sep 91  10 Sep 91  
LDIRB22 .FOR     4r   0.50k  Stored   20 Aug 91  10 Sep 91  
LDIRB22 .HZS    37r   4.62k Crunched  05 Sep 91  10 Sep 91  (-> LDIRB22.HIS)
LDIRB22 .ZZ0   127r  15.87k Crunched  20 Aug 91  10 Sep 91  (-> LDIRB22.Z80)
==============================================================================
LDIRB22 .LBR members: 5 matched, 5 active, 2 free, 0 deleted, 7 total
