home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / msdos / util / lu.doc < prev    next >
Text File  |  1987-10-08  |  6KB  |  148 lines

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