home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 014 / libtools.arc / LU.DOC < prev    next >
Encoding:
Text File  |  1984-02-27  |  6.0 KB  |  152 lines

  1.  
  2.  
  3. .he LU -- Library Utility for MSDOS    T. Jennings 15 Jan 84        Page #
  4. .op
  5.  
  6.     LU  is    a utility to manipulate "LBR" files generated  by
  7. the CP/M utility of the same name, or any of the MSDOS compatible
  8. ones.  The  most common use is to pack a group of  related  files
  9. into a single LBR file, for modem transfers or for archiving.
  10.  
  11.     LU  or    an  equivelant    program is  usually  required  to
  12. "unpack"  the  larger  software  packages  available  on   public
  13. Bulletin Board Systems.
  14.  
  15.     LBR  files  are  a  special  file  generated  by  LU  (or
  16. whatever)  that  contain  one or more DOS  files,  and    a  simple
  17. directory. Whenever an existing library is changed (files changed
  18. or  deleted)  the library requires "reorganizing".  More on  this
  19. below.
  20.  
  21.     LU  operation  is  quite simple.  Ther    are  only  a  few
  22. commands.  Each  is described below,  and a quick summary can  be
  23. obtained by running LU like so:
  24.  
  25.         LU <cr>
  26.  
  27. OPERATING LU
  28.  
  29.     LU  commands,  etc are entered on the command line  after
  30. the program name.  You must ALWAYS enter a command letter, below,
  31. and the name of an LBR file, followed by file names, if needed:
  32.  
  33.         LU <command> <lbr file name> { <optional filenames> }
  34.  
  35.     For example,
  36.  
  37.         LU T FILE.LBR
  38.  
  39.     Lists  all  the  files    contained  within  the    LBR  file
  40. FILE.LBR.
  41.  
  42.              L U    C O M M A N D S
  43.  
  44.     All LU commands are a single letter. Only one can be entered
  45. at a time.
  46.  
  47. A    Unpack all files from the library.  This is the same  as
  48. the E (extract) command,  followed by all the file names. Thi sis
  49. much easier if all you want to do is remove all the files.
  50.  
  51.  
  52. T    List all files contained in the LBR file.  Each filename
  53. is  listed,  along with the size of the file in  bytes,  and  its
  54. starting  offset  within  the LBR file.  (The  offset  is  pretty
  55. useless information, but there it is.)
  56.  
  57. L    Same as T.
  58.  
  59. E    Extract  a  file from the library.  The  file(s)  to  be
  60. extracted are entered after the LBR file name.    Each file will be
  61. extracted, and copied to a disk file of the same name.
  62.  
  63. U    Update    a  library.  This  is also used  to  create  new
  64. libraries.  File name(s) are entered after the LBR file name, and
  65. each  file  is added to the library.  Any file of the  sam  ename
  66. already  in  the library will be deleted  first,  otherwise  just
  67. added. Pleas read about reorganizing, below.
  68.  
  69.     If  the library file does not exist (creating a new  one)
  70. then  you are asked for the number of new slots for the  library.
  71. "Slots"  means the maximum number of files that the LBR file  can
  72. contain.  The number you enter is rounded up to the next  highest
  73. multiple  of  four;  this is just a peculiarity of the    LBR  file
  74. structure.  It    does not hurt anything.  After the new library is
  75. created, any specified files are added to it.
  76.  
  77. D    Delete a file. The just marks the file within the library
  78. as "deleted".  The library file will NOT change in size;  it does
  79. not remove the data contained by the file.  See "reorganization",
  80. below.
  81.  
  82. R    Reorganize  the library.  All free space  (from  deleted
  83. files,    or existing files that were Updated) is freed up, and the
  84. LBR file generally becomes smaller. Should be used after a Delete
  85. or Update command.  Creates a temporary file called LU$$$$$$.TMP,
  86. therfore you should not use this file name elsewhere.
  87.  
  88.              R E O R G A N I Z I N G
  89.  
  90.     The structure of an LBR file (described in detail  below)
  91. is very simple. Because of its simplicity, files that are deleted
  92. or changed still consume space within the LBR file, which must be
  93. "squeezed" whenever the library is changed.
  94.  
  95.     Deleteing  a file merely marks the file as "deleted";  it
  96. does not remove the data contained in the LBR file. Updated files
  97. are deleted first, and also consume space. Therefore, the library
  98. must be reorganized. This consists of creating a new library, and
  99. copying the active files to it,  dropping out all the deleted  or
  100. changed data.
  101.  
  102.     The  rule  is:    reorganize  after  deleting  a    file,  or
  103. updating a file that already existed.  If the library runs out of
  104. slots,    and you want to add more files,  reorganize and specify a
  105. larger number of slots. You can then add to the library.
  106.  
  107.     Reorganizing never does any harm, in any case.
  108.  
  109.  
  110.           L B R    F I L E      S T R U C T U R E
  111.  
  112.     The  LBR  file    is  a disk file that  contains    a  simple
  113. directory,  followed by all the data contained in the files.  New
  114. files  are added to the end of the LBR file,  and  the    directory
  115. entry for each file points to the data,  and contains its length.
  116. Each directory entry is:
  117.  
  118.     00:    file status (0= active, FF= deleted, FE= unused)
  119.     01:    11 character filename (FCB format)
  120.     12:    16 bit offset to start of data (in sectors)
  121.     14:    16 bit data length (in sectors)
  122.     16:    16 bytes of filler
  123.  
  124.     Since  the  original program was written in  BDS  C,  all
  125. offsets  and  lengths  are in multiples of 128    bytes,    the  CP/M
  126. "sector  size".  LU multiplies these values by 128 before  using.
  127. (Also, all file sizes are rounded up to the nearest 128 bytes.)
  128.  
  129.     The  offset  is the location of the data  for  the  file,
  130. relative to the start of the LBR file.
  131.  
  132.     The  first directory entry is the directory  itself.  The
  133. filename  is always blank, the offset is not used, and the length
  134. is the length of the directory. Since the length is a multiple of
  135. 128,  LU  rounds  up the number of slots when creating a new  LBR
  136. file to a multiple of four. (32 bytes per entry * 4 == 128).
  137.  
  138.             P E C U L I A R I T I E S
  139.  
  140.     There  are  only two peculiarities (nice  way  of  saying
  141. "bugs") that I know of: Filenames without extentions, like "FILE"
  142. instead  of "FILE.EXT" should be entered without a dot.  Entering
  143. with  a dot wil cause "NOT FOUND" errors to be  generated.  (I.e.
  144. use "FILE" not "FILE.".  Two, not really a bug, but a side effect
  145. of the original design:  all files are rounded up to the  nearest
  146. 128 bytes.  This does not matter for most files,  but some,  like
  147. spreadsheet  files,  will  not    work unless the size  is  exactly
  148. right.    LU (or equivalent) cannot be used with such files. Try it
  149. and see what happens.
  150.  
  151.  
  152.