home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / b_dir132.zip / B_DOC.TXT next >
Text File  |  1997-07-14  |  19KB  |  311 lines

  1. B.EXE directory lister for OS/2 and DOS
  2. Version 1.32 October, 1996
  3. Dohn Arms
  4.  
  5. Copyright 1996 Dohn Arms
  6.  
  7. Permission to use, copy and distribute this software and its documentation 
  8. for any purpose and without charging more than a nominal fee for copying is 
  9. hereby granted, provided that the above copyright notice appear in all copies 
  10. and that both that copyright notice and this permission notice appear in 
  11. supporting documentation.  This software is provided "as is" without express 
  12. or implied warranty.
  13.  
  14. This program is "freeware" which means that you do not have to pay for it.  
  15. It is not public domain, which means that I own the program and no one is 
  16. allowed to alter the program before redistributing it, which includes running
  17. B_EDIT on B.
  18.  
  19. The only thing that I ask of anybody that actually uses my program is that 
  20. if they have access to E-mail, that they send me a message telling me if my 
  21. program is particularly useful or not.  I just want to see that people 
  22. actually use this.  My E-mail address is: dohnarms@uiuc.edu . 
  23.  
  24.  
  25. What is this program?
  26.    This is a command line program that is to be used to view the contents of 
  27. a directory.  This program is designed to be an alternative for DIR.  It has 
  28. also has almost all of the functionality of DIR.  The reason I wrote the 
  29. program was because I disliked DIR and I wanted an easy way to view the 
  30. information contained in a directory.  Like DIR, you can also set default 
  31. switches in an environment variable.
  32.  
  33. What's with the name?
  34.    The name was simply a convenience for me due to the fact that I like one 
  35. letter names for programs that I use a lot.  I already had programs named C, 
  36. D, and E, so I named it B.  If you don't like this (which I would probably 
  37. think true), rename it to whatever you like.  The program is written with 
  38. renaming it in mind.  The help text (seen with /? switch) will reflect the 
  39. new name, as will the environment variable.  The only condition is that you 
  40. must keep the .EXE extension in the new name (there are ways to run EXE 
  41. programs after dropping the .EXE extensions).  So change B.EXE to BDIR.EXE if 
  42. you like, and look at the help screen.  The environment variable would then 
  43. be BDIR, also.
  44.    (I was in Germany for research, and I was using a DOS PC to do some
  45. programming.  I found a program named D.  Figuring it would be a program 
  46. similar to mine, I ran it.  It was my B, renamed to D!  Talk about weird!
  47. I never expected to run into my program in another country!)
  48.  
  49. What's with all these switches?
  50.    I love switches, thus this program relies heavily on switches.  Hopefully 
  51. you know how to use them, although I tried to make B useful even if you don't 
  52. change any of the settings.  Because of this, if you never use a switch, you 
  53. don't get to see half of what B can do.  PLEASE PLAY WITH THE SWITCHES!  Some 
  54. of the switches are of the type that you might use every once in a while from 
  55. the command line (like the one that goes and sums the sizes of the 
  56. subdirectories for you), while there are others that are useful only in the 
  57. environment variable or a CMD file as they are very long and not likely to be 
  58. changed (like the switch to change the colors of everything in the program).
  59.  
  60. Why is there no configuration file?
  61.    As this is a replacement for DIR, probably the most used command line 
  62. "program", I wanted to keep it fast, as I don't like to wait just to see the 
  63. file listing.  This is why there is no configuration file, as file IO is too 
  64. slow.  To set default settings, you must set the environment variable, 
  65. something that is not very hard and an important thing to know how to do, or 
  66. you can use a CMD file with the switches in it.  There is also an accompanying
  67. program, B_EDIT, which will allow one to alter the executable file to change 
  68. the default settings of the program instead of the variable or command files.
  69. There is a seperate document, B_EDIT.TXT, which describes B_EDIT.
  70.  
  71. Description:
  72.    When run with no switches, you will see all the files and subdirectories 
  73. in a directory.  The uppercase brown names are the subdirectories.  The gray 
  74. names are files that do not have an extension that is being searched for.  
  75. Anything of another color is a file of a searched-for extension; the colors 
  76. are yellow, light green, red, cyan, light cyan, and dark green (these are the 
  77. official names for these colors).  By default, the extensions for OS/2 are 
  78. EXE, COM, CMD, INF, TXT, and ZIP.  For DOS, they are EXE, COM, BAT, DOC, TXT, 
  79. and ZIP.  If there is an asterisk next to a subdirectory or a file, that 
  80. means that the file or subdirectory is hidden (from normal view, anyway) or 
  81. is a system file or both.  If the name of a file is uppercase, that means the 
  82. file is either read-only or is a system file or both (if the file is composed 
  83. of characters with no cases (such as numbers), you won't be able to tell).
  84.    Under the listing of files and subdirectories, the directory being shown 
  85. is displayed.  Under that is the total number of files shown, with the total 
  86. size of the files (I haven't fixed B to add EA's yet).  Also, to the side of 
  87. this is the total number of subdirectories shown.
  88.    If all the files can't fit onto the screen, the scrolling stops when the 
  89. maximum number per screen has scrolled by.  If you don't want to see any more 
  90. of the files, you can stop the scrolling by merely pressing the Escape key 
  91. ("Esc"), pressing Ctrl-C (the "C" key while the "Ctrl" key is pressed), or
  92. pressing Ctrl-Break (the "Pause" key while the "Ctrl" key is pressed).
  93. All the files that were visible remain visible on the screen.  In the wide 
  94. view (/W), you will only see file names.  In the default normal view (/N), 
  95. there will be a size in bytes next to each file, and a "<DIR>" next to 
  96. each subdirectory.  In the date-time view (/D), there will also be the time 
  97. and date of the last write of each file and directory.  If you are using one 
  98. of the previous views and if a file or subdirectory name is longer than 13 
  99. characters, in the OS/2 version of B, there will be a ">>" character at the 
  100. end showing that the file name has been cut off.  In the long view (/L), the 
  101. complete file name is shown, along with file attributes the and time up to a 
  102. two-second interval.
  103.    Using the sort switch (/O), you can change how the files and directories 
  104. are sorted.  You can choose to not sort (/OU). There is the default sort by 
  105. name (/ON), sort by extension (/OE), sort by size (/OS), and sort by time 
  106. (/OT).  Using the last three switches, if files have the same extension, 
  107. size, or time, they will be sub-sorted according to name.  You can specify a 
  108. reverse sort for any of them (except /OU) by adding a negative sign before 
  109. the second letter (such as /O-N for a reverse name sort).
  110.    There is a switch that allows the directories to be grouped apart from the 
  111. files (/G).  It is on by default, but can be turned off with /-G.
  112.    If you wish to see only files, using the file-only switch (/JF) will 
  113. remove all subdirectories.  If you wish to just see the subdirectories, using 
  114. the subdirectory-only switch (/JD) will show only subdirectories.  To see 
  115. both files and directories, the default, use the all switch (/JA).
  116.    If you wished to see the free space on the disk where the directory viewed 
  117. is, use the free-space switch (/F) and the information will appear at the 
  118. bottom, along with the total space on the disk and the volume label.
  119.    If you want to see what the extensions being highlighted actually are, use 
  120. the extension viewing switch (/E), and they will appear in their respective 
  121. colors at the bottom of the screen.
  122.    If you want to see the total sizes of subdirectory trees and the total 
  123. size of the current directory tree, using the size summing switch (/Z) will 
  124. have the "<DIR>" next to each subdirectory replaced with its size in 
  125. kilobytes (1 K = 1024 bytes).  Also, at the bottom, the total directory size 
  126. will be displayed.  If you were using the name-only mode (/W), it will 
  127. automatically be kicked up to the name and size only mode (/N), as you would 
  128. probably want to see the sizes.
  129.    If you wish to do a recursive search through subdirectories, there is the 
  130. recursive switch (/S).  From the directory that is specified, and the file 
  131. mask also specified, all the files matching the mask in the specified 
  132. directory and any subdirectories in this directory will be shown.  For every 
  133. directory, if any files are found, the files will be shown, with the 
  134. directory being shown under it.  As this switch is almost a separate program, 
  135. a find utility, many switches don't work with it: these are /F, /E, /P, and 
  136. /I.  If the size summing switch (/Z) is used with it, it will show the total 
  137. size of the files in each directory, and will also sum the size of all the 
  138. files found at the end.
  139.    There is a switch for putting the path and mask after the files and 
  140. directories are shown (/P).  This is on by default, but this switch 
  141. effectively lets you turn it off with /-P.
  142.    There is a switch that shows the number of files and directories, and the 
  143. total size of all the files in the directory (/I).  This is on by default, 
  144. but can be turned off with /-I.
  145.    For cosmetic purposes, if the number of files and directories is equal or 
  146. below a certain number, they will be shown in one column.  This number is 4 
  147. by default.  If the number of entries is from 5 through 8, they will be shown 
  148. in two columns if possible, etc.  There is a switch to change this number 
  149. (/H).  You can use a number from 1 to 9, and just set it right after the /H.  
  150. For example, to set this number to 3, use /H3.
  151.    If you don't want to see any of the extraneous information after the files 
  152. and directories are shown, and if you want what is shown as compact as 
  153. possible, use the bare switch (/B).  Effectively, this fits the most on the 
  154. screen for you if you need to conserve space.  This is not actually a  true' 
  155. switch, as it really just is shorthand for /-F /-E /-P /-I /-Z /H1 which 
  156. means it turns off a bunch of other switches.  Because it is not a  true' 
  157. switch, it can't be reversed.
  158.    If you want to redirect the output of B say to a file or printer, the 
  159. output has to be in the form of a colorless TTY mode.  To force this mode, 
  160. there is a switch (/T).  The output will not be in colors, does not pause, 
  161. and there are no breaks.  
  162. [NOTE: If you don't know what I am talking about, to save the output of B to 
  163. a file, use the following: "B (switches) /T > (filename)".  The  >' redirects 
  164. the output into a file with name  filename'.  To redirect the output to the 
  165. printer, use the following: "B (switches) /T > PRN".]
  166.    Most people will probably want to change the default extensions to suit 
  167. their needs.  The extension changing switch (/C) will allow this.  You can 
  168. supply a list of up to sixteen extensions, each having up to three letters.  
  169. To do this, simply space out each extension after the /C switch.  For 
  170. example, the default OS/2 extensions would be added like this: 
  171. /C COM EXE CMD INF TXT ZIP
  172. The DOS extensions I use are:
  173. /C COM EXE BAT DOC TXT ZIP C CPP H HPP GIF JPG DAT ASM TEX
  174. The default colors taken by the extensions are all different.  You can change 
  175. all 16 colors, with some being repetitive if you want, with the color switch 
  176. (/A).
  177.    Some people might want to change the default colors.  To do this, there is 
  178. a switch to alter the color scheme (/A), which you may find cryptic.  You can 
  179. specify colors for any of the 15 text types: 1) the color of any information 
  180. text seen, 2) the color of the subdirectories, 3) the color of the 
  181. unhighlighted files, 4) the color of extension one, ... , and 15) the color 
  182. of extension twelve.  These allowable colors and their numeric equivalents 
  183. are shown in the table below.  The complete way to set this switch is to put 
  184. after the /A the first foreground color, then a comma (you can't change the 
  185. background color of the information text), then the second foreground color, 
  186. then a colon, then the second background color, then a comma, then the third 
  187. foreground color, then a colon, ... , then the fifteenth foreground color, 
  188. then a colon, and then the fifteenth background color.  For a full example of 
  189. this (this can be abbreviated, as explained later):
  190. /A5,11:4,10:2,4:7,2:6,5:0,0:7,13:3,9:3,14:1,3:6,1:4,15:3,11:4,1:6,8:3,7:0,12:3,2:6
  191. You do not have to specify every color for every text type, but can skip 
  192. some, as their colors will remain the same as before the /A switch.  You can 
  193. skip either the foreground color or the background color or both for a text 
  194. type.  To skip both, just put nothing in between the commas.  To skip the 
  195. foreground color, just don't put a color number between the comma and the 
  196. colon.  To skip the background color, don't put either the colon or the 
  197. background color.  You don't even need to specify all 15 colors, but can just 
  198. specify the first, for example, 10 colors.  For example:
  199. /A,4,1,4:7,,,14,10:3,,:5
  200. You only need to specify what you want to change.  If you want to only use 
  201. your normal background color (probably black), just don't even touch the 
  202. background colors:
  203. /A5,11,10,4,2,5,0,13,9,14,3,1,15,11,1,8,7,12,2
  204. [NOTE: you can't change the background color of the first /A color, although 
  205. it won't give you an error if you try.]
  206.    
  207. COLORS:  you may choose from 0 - 15 for foreground, 0 - 7 for background
  208.  0 = black         1 = blue              2 = green          3 = cyan
  209.  4 = red           5 = magenta           6 = brown          7 = light gray
  210.  8 = dark gray     9 = light blue       10 = light green    11 = light cyan
  211. 12 = light red    13 = light magenta    14 = yellow         15 = white
  212. To see the actual colors on the screen, use the /? switch, as it shows them 
  213. all.
  214.  
  215.    B will add implicit wildcards, like MS-DOS.  If you use "B CAT", it will 
  216. expand it to "B CAT.*".  If you use "B .ZIP", it will expand it to "B *.ZIP".  
  217. For DOS, if you use "B CR*", it will be expanded to "B CR*.*".
  218.    If switches are already set, and you don't want them set, you can always 
  219. turn them off.  For most switches, simply add a negative sign before the 
  220. switch letter; for example, to turn off /F, one would use /-F.
  221.    You do not have to put spaces between the switches.  Only one switch does 
  222. not conform to this, being /C, which explicitly needs spaces in the first 
  223. place.  (This is a legacy thing since /C was the first switch I implemented, 
  224. and I am thinking of changing it to use commas in between.)
  225.    If you like a certain set of switches to be used by default, you can put 
  226. them into the environment variable.  To do this, the command looks like:
  227. SET B=(switches)
  228. You can do this from the command line, or you can put it in your CONFIG.SYS 
  229. (for OS/2) or AUTOEXEC.BAT (for DOS).  An example would look like:
  230. SET B=/F /O-D /A,4 /C C ZIP EXE CMD H
  231. [NOTE:  If you changed the name of B to something else, the environment 
  232. variable will also be changed from B.  If you renamed B.EXE to BDIR.EXE, the 
  233. variable would be BDIR.]
  234.    A different way which is slower, but easier, is to create a command file 
  235. (for OS/2) or a batch file (for DOS).  All you would have to do is create the 
  236. file with the correct extension, CMD for a command file or BAT for a batch 
  237. file.  The only line needed would look like:
  238. (path)B.EXE (command line switches) %1 %2 %3 %4 %5 %6
  239. A sample CMD file, say BB.CMD, could look like:
  240. E:\TOOLS\B.EXE /D /F /-P /C EXE COM CMD C CPP H HPP %1 %2 %3 %4 %5 %6
  241. [NOTE:  If you don't know this, you need to include the %1, %2, etc. because 
  242. these allow you to pass arguments to the CMD or BAT file.  Also, I wouldn't 
  243. name your CMD or BAT file the same as what you name B, if B is in your path, 
  244. as an EXE takes precedence over a CMD or BAT file; i.e. don't name your file 
  245. B.CMD if you leave B as B.EXE and it is in your path.]
  246. Once you make your file, make sure you put it in the path.
  247.    The last way is to use the B_EDIT program, which has the document B_EDIT.TXT
  248. to explain how to use it.  You need the same switch information as above for
  249. B_EDIT, as it uses the same switches.
  250.    If you want to know what switches are on by default, using the help screen 
  251. (/?) will show you the switches on, except for /A and /C which would take up 
  252. too much room.
  253.  
  254.  
  255. Form of Command:
  256. B.EXE [path][wildcard] [/?] [/W|/N|/D|/L] [/J<F|D|A>] [/O[-]<N|S|E|D|U>] [/B] 
  257. [/[-]S] [/[-]Z] [/[-]T] [/[-]F] [/[-]E] [/[-]P] [/[-]I] [/[-]G] [/H(1-9)] 
  258. [/C [ext 1] ... [ext 16]] [/A[f1],[f2][:b2],...,[f19][:b19]]
  259.  
  260. /?    The help screen
  261. /W   Wide view (uses five columns with only file names)
  262. /N    Normal view (uses three columns and adds file sizes)
  263. /D    Detail view (uses two columns and adds dates and times)
  264. /L     Long view (uses one column and adds long names and attributes)
  265. /J%   Just show files, directories, or both.
  266.            /JF   Shows just files
  267.            /JD  Shows just directories
  268.            /JA   Shows both files and directories
  269. /O[-]%  Changes sort order, '-' before % does reverse sort
  270.            /ON Does alphabetical sort of the names
  271.            /OS Does numerical sort of the sizes
  272.            /OE Does alphabetical sort of the extensions
  273.            /OD Does chronological sort of the times and dates
  274.            /OU Does not sort at all
  275. /[-]B  Shows only bare format of just directory and file names  
  276. /[-]S  Does a recursive search through subdirectories using mask
  277. /[-]Z  Sums the sizes in each subdirectory tree and in current directory tree
  278. /[-]T  Outputs the information in TTY mode for redirection
  279. /[-]F  Shows the free space on the disk where you are viewing the directory
  280. /[-]E  Shows the extensions used for highlighting in their highlighting colors
  281. /[-]P  Shows the path and mask for the directory being viewed
  282. /[-]I  Shows the number of files and directories and total size of the files
  283. /[-]G  Groups the directories apart from the files
  284. /H%  Sets the minimum column height before starting new column to %
  285. /C [extension 1] [extension 2] ... [extension 15] [extension 16] 
  286.    Changes highlighting extensions to those specified 
  287. /A[fc1],[fc2][:bc2],[fc3][:bc3],...,[fc18][:bc18],[fc19][:bc19] 
  288.     Changes the color scheme: bc = background color and fc = foreground color
  289.     Text order is: information, directories, unhighlighted files, 
  290.     extension 1, ..., extension 12
  291.     The colors are:
  292.        0 = black         1 = blue             2 = green         3 = cyan
  293.        4 = red           5 = magenta          6 = brown         7 = light gray
  294.        8 = dark gray     9 = light blue      10 = light green   11 = light cyan
  295.       12 = light red    13 = light magenta   14 = yellow        15 = white
  296.  
  297. To set default switches: "SET B=(command line arguments)"
  298.  
  299.  
  300.  
  301. Contacting the Author:
  302.    If you have any comments or questions about my program, feel free to 
  303. E-mail me or write me.  If you find bugs, please tell me.  I actually want to 
  304. hear from you if you actually use this, so I know my work in putting this on 
  305. the Internet has not been in vain.  I hope you find this useful.
  306. E-Mail:      dohnarms@uiuc.edu
  307. Mail:        Dohn Arms
  308.              Loomis Laboratory of Physics
  309.              1110 West Green Street
  310.              Urbana, IL  61801-3080
  311.