home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 164_01 / lu.doc < prev    next >
Text File  |  1984-03-24  |  6KB  |  149 lines

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