home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 181_01 / catlbr.doc < prev    next >
Text File  |  1979-12-31  |  6KB  |  166 lines

  1. CATLBR.DOC     A system to CATALOG 'internal' files
  2. October 16, 1983
  3. Joe Vogler
  4.  
  5.    This library contains a collection of KLUDGEY tools to allow 
  6. one to maintain the names of INTERNAL files in a MAST.CAT file.  
  7. If you don't know what an INTERNAL file is, read LU.DOC.  The 
  8. last version of LU.COM I know of is 3.00.  But you can learn 
  9. about INTERNAL files from the doc files for earlier versions.
  10.    My approach goes back to the original programs that formed the 
  11. Public Domain Catalog System.  These were (among others, I 
  12. suppose) 
  13.  
  14.   FMAP.COM - Multipurpose program to generate custom SUB files 
  15.   and to create the NAMES.SUB file used by CAT2.COM.
  16.  
  17.   CAT2.COM  - Updates the MAST.CAT file using the data contained 
  18.   in the file NAMES.SUB.
  19.  
  20.    I did things much the same way.  LDIRSORT.COM is a 
  21. modification of LDIR v1.0, written by Gary Novosielski.  I added 
  22. sorted output and the option to generate a NAMES.SUB file for one 
  23. of the LBR's named on the command line.  The file option is 
  24. selected by preceeding the desired LBR with a '-' and a space.  
  25. Additional documentation for LDIRSORT is available by running the 
  26. program with no arguments.
  27.    If the file option is selected, LDIRSORT constructs a dummy 
  28. LABEL file using the NAME of the LBR.  For example, for an LBR 
  29. named PROGS.LBR, the label file would be '-PROGS.LBR'.  If 
  30. PROGS.LBR contained the files FILE1.C, FILE2.C, & FILE3.C, the 
  31. NAMES.SUB file would look like this:
  32.  
  33.     -PROGS.LBR
  34.     FILE1.C
  35.     FILE2.C
  36.     FILE3.C
  37.  
  38.    When incorporated into your MAST.CAT file, these entries would 
  39. look like this:
  40.  
  41.     FILE1.C,PROGS.LBR
  42.     FILE2.C,PROGS.LBR
  43.     FILE3.C,PROGS.LBR
  44.  
  45.  
  46. Here's how to catalog a single LBR file:
  47. ----------------------------------------
  48.   A> ldirsort - <lbrname>
  49.   ...  (program output)
  50.  
  51.   A> cat2
  52.   ...  (program output)
  53.  
  54.   A>
  55. ----------------------------------------
  56.  
  57.    There are several known limitations to this method of 
  58. cataloging internal files:
  59.  
  60.   1)  The physical volume ID is not stored with the file entries 
  61.   in MAST.CAT.  You must first find the reference to the LBR 
  62.   dummy and then run CAT.COM again to find out which disk 
  63.   contains your file.
  64.  
  65.   2)  If you catalog more than one LBR file with the same name, 
  66.   your MAST.CAT will not tell you which one contains a particular 
  67.   internal file.  The solution to this is to avoid using the same 
  68.   name more than once unless the files are duplicates.
  69.  
  70.   3)  You cannot catalog an LBR file if its name exceeds 7 
  71.   characters in length.  You must leave room for the '-' that 
  72.   goes into the dummy label entry of the NAMES.SUB file.  This 
  73.   could be handy, since you could assign 8 character names to all 
  74.   LBR files that you don't want to catalog.
  75.  
  76.   4)  Each LBR file requires a separate update of MAST.CAT.  If 
  77.   you have high density disks and/or many LBR's on the same 
  78.   diskette, you could spend a great deal of time watching CAT2 
  79.   repeatedly read and write your MAST.CAT file.  CAT2 is not as 
  80.   efficient as NCAT, since it's disk buffers are smaller.
  81.  
  82.    To make it easier to catalog several LBR files, I wrote a 
  83. quickie program, CATLBR.COM, that creates a SUB file containing a 
  84. job stream for cataloging all of the LBR's named on the command 
  85. line.  This SUB file allows anyone to go have lunch while the 
  86. computer chugs away.
  87.    I have prepared a SUB file that executes CATLBR.COM and then 
  88. submits the SUB file just built.  This allows the entire 
  89. operation to be handled with a single command (if you really want 
  90. to recatalog ALL of the LBR's on a diskette).
  91.    Typical usage where MAST.CAT and all programs are on Drive A: 
  92. and the LBR files are on B:.
  93. ------------------------------
  94.   A> submit catall b<CR>
  95.   ...
  96.   ...
  97.   ...  (Lots of program output
  98.  
  99.   A>
  100. ------------------------------
  101.  
  102. Listing of CATALL.SUB:
  103. ===============================
  104. xsub
  105. catlbr $1:*.lbr
  106. submit commands ldirsort cat2 -
  107. ===============================
  108.  
  109.    The program CATLBR.COM builds a custom SUB file that controls 
  110. all cataloging. For example, if my B drive contained 3 LBR files, 
  111. CPMUG081.LBR, CPMG078..LBR, and CPMG077.LBR, then CATLBR.COM 
  112. would build this COMMANDS.SUB file:
  113.  
  114. $1 $3 D:CPMG081.LBR
  115. $2
  116. $1 $3 D:CPMG078.LBR
  117. $2
  118. $1 $3 D:CPMG077.LBR
  119. $2
  120.  
  121.    When expanded by XSUB, the file COMMANDS.SUB will look like 
  122. this:
  123.  
  124. LDIRSORT - D:CPMG081.LBR
  125. CAT2
  126. LDIRSORT - D:CPMG078.LBR
  127. CAT2
  128. LDIRSORT - D:CPMG077.LBR
  129. CAT2
  130.  
  131.    You won't see the expanded version since it is the $$$.SUB 
  132. file that is built by SUBMIT.
  133.    CATLBR.COM can be used (manually) to create a SUB file to 
  134. catalog a subset of all the LBR's on all drives.  It was written 
  135. in BDS C using the WILDEXP() function.  If you have the 
  136. documentation for this compiler, read about this function.  
  137. Briefly, CATLBR.COM can be invoked with a full 128 character 
  138. command line filled with file names (ambiguous and unambiguous) 
  139. as arguments.  Any of the arguments can be combined with a '!' 
  140. prefix to indicate that matching filenames are to be excluded.  
  141. For example:
  142.  
  143. A> catlbr b:*.lbr !b:this.lbr !b:that.lbr !those???.lbr c:*.lbr
  144.  
  145.    This invokation will build a COMMANDS.SUB file for all LBR 
  146. files on drives b: and c:, except B:THIS.LBR,  B:THAT.LBR and 
  147. files matching the ambiguous name B:THOSE???.LBR or 
  148. (B:THOSE*.LBR).  You can mix and match on drives too.  Be sure to 
  149. include the drive designator on each argument.  If no drive is 
  150. specified, an argument will apply to the default drive.
  151.    Here's how to submit the file COMMANDS.SUB:
  152.  
  153. A> submit commands ldirsort cat2 -
  154.              |         |     |   |
  155.              |         |     |    \__($3) 'File' option for ldirsort
  156.              |         |      \______($2)
  157.              |          \____________($1)
  158.               \______________________name of sub file
  159.  
  160.    CATLBR works with all types of files.  Thus, the COMMANDS.SUB 
  161. file can be used for other purposes.  Also, if you have BDS C 
  162. v1.4x or better, you can easily modify CATLBR.C to make it create 
  163. different SUB files.  I left some spaces in the COM file so that 
  164. CATLBR can be modified by hot patching.  The strings you would 
  165. need to modify are in the ninth 256-byte page of the COM file.
  166.