Dec 272017
Utility to display various directory options.
File UD175_N.ZIP from The Programmer’s Corner in
Category File Managers
Utility to display various directory options.
File Name File Size Zip Size Zip Type
UD.COM 15268 9679 deflated
UD.DOC 8796 3452 deflated

Download File UD175_N.ZIP Here

Contents of the UD.DOC file

Version 1.75
By Ryan Sells

UltraDir (or UD) is yet another test of my C programming abilities. It is
meant as a faster and nicer version of the DOS DIR command, yet incorporating
good parts from AT&T's UNIX LS command.
UltraDir can now handle command-line options. These are:
-A List everything
-D List directories
-H List hidden files
-N List normal files
-R List read-only files
-S List system files
-W Use wide mode
D:\PATH\ List files in D:\PATH\
Acceptable \PATH\s:
Default is *.*
A '/' instead of a '\' is permissible

Switches preceded by a '-' can be stacked. Example:
UD D:/SOURCE/ -SRH is the same as UD D:\SOURCE\*.* -S -R -H
UD D: -ND is the same as UD D:\*.* -N -D

When specifying a , do it just as you would with DIR. This
means that "UD*." would list every file or directory whose first two letters
are UD, and that have NO extension. "UD*" would list every file or directory
whose first two letters are UD, extension or no (this is because, with version
1.53 and up, if the program sees no period in the a ".*" is
automatically added at the end).

Before version 1.73, if you were in the root directory and wished to list
the QBBS directory's entries, you would have to use "QBBS\" as the filespec.
No longer; now, simply "QBBS" will do. This "dir\" bug was fixed by using a
stat() call and checking if the given was a directory. So you can
list directories with UD just like DOS lists 'em!
As I later discovered, version 1.73 also added an error where, seemingly
at random, a like "\GAMES\POKER*" would expand to
"\GAMES\POKER*\*.*". This was caused by an incorrect coding of the above scan
routine. This was fixed in version 1.74.

A minor bug has been included in _ALL_ versions of UD up to version 1.74.
Now, a like "..\QBBS\NODE*" will expand properly to
"..\QBBS\NODE*.*". Up until v1.74, it would have been left as it was.

"No file handling" was added with v1.74A. This is a rather simple step,
and why I did not add it afore that version is beyond me. What "no file
handling" does is to print the message "No files or directories found" when the
that you entered or the default "*.*" caused no files or directories
to be found. Also, UD will exit with a DOS ERRORLEVEL of 1. This is useful
for batch files (especially if you just can't remember the syntax for the IF
EXIST command).

In wide mode, a "\" is displayed after every directory. So a file named
UD is simply "UD", but a directory named UD is "UD\".

For short help with command line flags, type UD -?.

When UD is listing, you can pause it by pressing any key. Press any key
again to restart it. A "S" will stop the listing (like a ^C).

PKARC and some other programs used to cause UD to come up with a "(null)"
as the CWD (Current Working Directory), but version 1.52 fixed that.
With version 1.71, a different method of looping the directory search
routine was initiated. This routine would print a line of garbage if no files
were found in the directory. This bug was fixed with version 1.72.
Previous versions to 1.72 would only show the space left on the current
drive, and would say that any label found on another drive was that of the CWD.

After version 1.75, you, the user, may now choose what color UD will use
when displaying things. To do so, set an environment variable called ABSNORM
(probably in your AUTOEXEC.BAT file) equal to the color of your choice. To
pick a color, follow the below simple rules:
Start with 0.
If you want it to blink, add 128.
If you want it to be high intensity, add 8.
Pick a foreground color. Add the color code below:
Black 0
Blue 1
Green 2
Cyan 3
Red 4
Magenta 5
Yellow 6
White 7
Pick a background color. Add color code as above, but multiply by 16
For example:
Say you want low intensity, blinking red on a magenta background.
Your value for ABSNORM would be 212:

128 [blink]
0 [low intensity] 16 [Background color]
+ 4 [Red foreground] * 5 [Magenta background]
--- ---
132 [Subtotal 1] 80 [Subtotal 2]

132 [Subtotal 1]
+ 80 [Subtotal 2]
212 [Grand total]

I have been continuously improving this program for a while now, and it is
coming along rather well. Here is what will be in later versions:


Revision History
1.00 -- The first!
1.10 -- Pause and S)top added
Diplay neatened
1.20 -- Totals added
Flags displayed neatened again
1.30 -- Time/Date display added
1.31 -- Improved display
1.40 -- List other dirs than the CWD
1.50 -- List files by flags
1.51 -- Command line help added ("-?" switch)
1.52 -- Fixed bug with "D:" file specifier
Fixed "(null)" CWD reading caused by PKARC
1.53 -- Added ".*" addition
"-?" help shortened, culls transferred to this file
1.60 -- Wide mode added
"S" exit screen mess-up bug fixed
1.70 -- Search bottleneck lessened through rewrite
1.71 -- Wide mode display neatened
Command line processing speeded up
1.72 -- "Other disk free space" error fixed
Missing file bug fixed
Other-drive-volume-label bug fixed
Optimized with DLC Optimum-C
1.72A -- Minor omission from help function fixed
1.72B -- Fixed "Space left" bug that cropped up in 1.72
1.72C -- Removed cursor from display during screen writes
Screen now displayed as HighWhite instead of LowWhite (non-Mono)
Mistake causing 'dead code' eliminated
1.73 -- "Dir\" bug fixed
1.74 -- "..\Qbbs\Node*" bug fixed
1.74A -- "No file handling" was added
1.74B -- Different print string function used
Minor error in help function fixed
1.75 -- Color specification allowed
"Dir\" bug REALLY fixed (no joke!)


Special Thanks
I would like to give special thanks to Allen Holub who made the way to
decode DOS' UNIX-style time/date word so simple and obvious.


End Notes
Newer versions shall be released as they are written.
This product is supplied (this version only) as "Freeware." What does
this mean? It means you don't pay anything and that I don't have to give
anything to you either. It also means that this ISN'T "public domain" -- that
means that it is still copyrighted by me. It also means that I am not liable
for anything having anything whatsoever to do with damage or fees incurred or
anything having to do with using or not using this product. It also means that
there is no guarantee that this does anything worthwhile either.
This product may NOT be sold without written consent of the author. No
fee may be charged for its distribution, and it may not placed as available for
download on a BBS that requires a fee for said download. If you want to give
this progam to someone on a disk, then GIVE it to them -- to accept any form
of payment in return is a violation of this document/agreement.
By the way, you may contact me, or check out what other stuff I have
released at....

Ryan Sells
The Gravity Well QBBS
300/1200/2400 bps
9pm - noon PDT
(707) 426-0511
FidoNet 1:161/6.0

 December 27, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>