B.EXE Changes / Bug Fixes Version 1.1 all done around November 26, 1994. Fixed a bug that incorrectly reported a directory with even megabytes of files as multiples of .1 Meg of files. This had to do with the fact that, in computing the number of Megs of files, I do not actually do any floating point dividing, but instead do integer math, and the error came from trying to round the numbers. I dropped the number rounding. I changed the program so that it will read its "name" from the command line, so that if you change its name, such as from B.EXE to PROGRAM.EXE, it will "know" itself as PROGRAM.EXE. The help text ( /? for the switch ) will reflect this, as will the system variable that must be set. Thus, if you don't like the name B.EXE, you can change it for all practical purposes. However, the .EXE ending needs to be kept. I fixed the counting for when and where to pause when the number of files and directories would be off the screen so as to take the bar along the top that OS/2 creates in command line sessions by default into consideration. I added a way to stop the directory scroll at a certain point, so as to get back to the command line. All one has to do is hit the 'Esc' key now, and you immediately get the command prompt, and all of the entries that were on the screen stay on the screen. If one used the system variable, there was no way to clear switches that were already set, from the command line. Now all the switches, except for the ones which control how many columns appear on the screen ( /w /n /d /l ) and the one that changes the highlighting extensions ( /c ), will now toggle, so that if you use them twice, they are negated. The reason I don't do this for the ones that control the columns is that the /n switch effectively clears both /w and /d already. I don't know if anyone will actually use this toggle 'feature', but it's there. Version 1.11 all done around December 5, 1994. When rewriting internal stuff for 1.1 fix, I screwed up the /D switch so that it does not show the size of files. I fixed this so that you can see the sizes now. This was corrupted in both versions, DOS and OS/2. Version 1.2 all done around March 18, 1995 I am not including IBM Works versions of the text since I don't have it installed since I have Word Perfect 6.1 now to use. I brilliantly realized that having two separate source files for the two versions was a little stupid, since I can use the #ifdef directives in C to add in specific code. Now I don't have to worry that I forgot to change in one version something I changed in the other. This was a big problem before. I cut out a lot of dumb code, by thinking up clean and compact C++ code. I am now utilizing unions to the maximum. Fixed a lot of bugs. Fixed /S not working in OS/2. Fixed a problem with /C being the last parameter in the environment variable. If /C was the last thing in your environment variable, the next thing on the command line would be looked at as if it was an extension for /C; this was fixed. I fixed a few other /C problems. Due to user demand, I have added /A to allow one to change the default colors of my program. Why did I put it as a switch? Accessing a file is WAY too slow, and file access adds a lot of code. Another environment variable would be too weird. A switch is fast, and it allows one to use it in aliases. Obviously, I wouldn't expect anyone to type in /A with all 9 colors every time. Due to user demand, I added in sorting (with reverse sort also). You can sort by name (default), extension, time, and size. You can choose to not sort. The directories stay grouped together out of the way; files and directories are separate classes in my program, and I didn't feel like messing with ungrouping them. I changed the /O switch from showing only files, to the sort switch, to be like DOS (sort of), and the old /O became /K instead. (From "files O'nly" to " K'ill subdirectories", I guess.) Due to user demand, I added more extensions to the /C switch. I added one more color (dark green by default) for the sixth extension, then extensions 7 - 12 take on the same colors as extensions 1 - 6. Hopefully twelve extensions are enough. I allowed /L for the DOS version to work. /L will now show explicitly what attributes the file has, especially since files consisting only of numbers can not be capitalized for read-only files. I also added, for laughs, the time up to a half-second on the files and directories; why anyone would need this is beyond me. Due to user demand, using .ZIP for instance as an argument would be transformed to *.ZIP, as in MSDOS. Also, the DOS version would transform ABC* as ABC*.* (the OS/2 version doesn't need it). Version 1.3 all done around July, 1995 Moved the -' sign from the back to in front of the second letter in /O, i.e. to reverse sort such as in size, you must now use /O-S', instead of /OS-'. Changed /S to /JD, and /K to /JF ( just directories' and just files'), as they make more sense, and I wanted /S to make it mean the same thing as DIR's /S switch. Using /OS will automatically bump you up to /N from /W so that you can see the sizes automatically. Using /OD will automatically bump you up to /D from /N or /W. I made it so that the switches were now absolute, instead of toggling. If you use the same switch twice, such as "/F /F", it will stay as /F, instead of just disappearing. Instead, I now added the ability to just add a '-' in front to disable the switch, such as /-F to disable /F. This makes more sense, and is consistent with DIR. I made the switch processing engine' much less forgiving, and if you don't use the right switches as shown in the help, it will generate an error. Killed the lines that would be left behind after pauses, as they were annoying. I fixed the bug in /L, where I show half-seconds'. I misread the Borland C++ help files, as what I thought were half-seconds were (seconds)/2, as in seconds/2 = x, or seconds = 2x. What I thought were half-seconds were two-second intervals. Oh well. You do not to put spaces between switches now, as in UNIX. This applies to all switches except for /C where the spaces are still needed. Added the volume label to the /F switch. It is a little flaky, as it has problems with keeping spaces in the right places if they are near positions 8 or 9 in the label. Specifying B as the file mask will automatically be transformed to B.*, as with the MS-DOS DIR. You no longer have to specify every color with /A anymore. You can skip colors you want to leave alone, such as /A,,5,3 if you wanted. You now can specify up to 12 highlighting colors now, if one wanted, as the colors no longer cycle any more after 6. I used the remaining colors for the last 6 default extension colors. Also, you can specify a background color if you want by using :' after the foreground color, such as by /A,11:5,,:3,,14. The background color can only be from 0 to 7. You can just specify the background without specifying the foreground. You can't specify the background of the first parameter for /A (information), as it would have been annoying to make it work. I added /T for teletype mode, as some wanted to redirect the output to a file or printer. What this does is effectively kill the colors, by using printf instead of cprintf. I did this easily with a function pointer. The output does not pause, however, and is not broken by the breaks subsequently. Just use "B > PRN" or "B > filename" to print or capture to file. I added 4 switches in the process of adding the /B switch. /I is the one responsible for showing the number of files and directories and the directory size. /P is the one responsible for showing the current directory and mask. /G is for grouping the directories away from the files. These 3 are all on by default, and can be turned off. /H is responsible for how tall a column must be before a new one is started. If /H is set to 4, if there are four directory entries, there is only one column. If there are 5 entries, a second column is started. These switches might all seem dumb, but they were essentially free as they took very little code. I added a switch to take out all the extraneous information in one swoop, /B, similar to DIR's. It turns off /Z, /F, /E, /I, /P, and sets /H to 1. This is useful to fit only the essentials on the screen. I added to the help screen (/?) what switches are already in use, except for /A and /C which would take up too much room. This is just so people can tell what actually is turned on. I added a new /S switch which does the same as DIR's. It recursively searches through the subdirectories. THIS SWITCH WAS A BIG PAIN IN THE BUTT TO WRITE. It has a few quirks that I am going to iron out, but it works okay. I added 4 more extensions, making 16 extensions available to set. Go bananas with extensions! In this version, I cut out a lot of extra code that wasn't needed. I combined my two classes into one, as it actually saved on code. Version 1.31 all done around October, 1995 I screwed up the DOS version's environment variable buffer thing inside the program. If it is too long, the program freaks out. This is from writing over unallocated memory areas! Oops! I kept forgetting to release this. I did not change the OS/2 version. Future Changes: All of this is up to time constraints. I am working on my PhD in physics, so I have little time for programming! I just bought Watcom C/C++ 10.0, and I plan to rewrite B with this compiler. I plan to rewrite the OS/2 version with true API calls, adding EA's to it with the /L switch. I have been stating this since 1.0, but I now have the tools to do it. I have to figure out the API calls for colored text in a command line session. If I get REAL bored, I might write a seperate program which will patch default settings right into B, by putting labels in my program for it to look for. This way, you won't need monster switch statements for your default settings, and this way is actually faster. No more parsing down the switches and interpreting them. I hate setting all the damn switches, too! I don't configure B to my preferences, as I am sure they would not be universally accepted. (Very iffy) I plan to add the ability to read ZIP files if they are given as an argument, and list the files as if they were in an actual directory. This will take some time since I know nothing about how ZIP files are set up, still. With this option, I won't need to use UNZIP -v to read ZIP file directories. If you find any bugs in my program, or want to suggest a change, email me at: dohnarms@uiuc.edu or mail me at: Dohn Arms Loomis Laboratory of Physics 1110 West Green Street Urbana, IL 61801-3080 I am rather open to suggestions to improve my program if it doesn't take a lot of effort to hack it into my code or if it doesn't get in the way of this being mainly an alternative for the DIR command. ("B now will answer your EMAIL for you, write your physics doctoral thesis, generate the Great American Novel, and prove Fermat's Last Theorem, while still giving you the contents of a directory, which is what you've come to expect from B!!!")