(HS) D.EXE - Version 1.69 - By Hafthor Stefansson
*** 10th Anniversary Edition ***
(C)opyright 2000 - All Rights Reserved
Made Using QuickAssembler(TM)/QuickC(TM) v2.51
Runtime by Microsoft(R)

Visit the Official HSD HQ!:
http://home.earthlink.net/~hafthor/d.html

-[ Copyright / Legal Agreement ]---------------------------
   (C)opyright 2000 - All Rights Reserved

    * IMPORTANT: Use of this program constitutes acceptance
      of the terms and conditions of this agreement.

    * This program may be used free of charge except for by
      for-profit businesses and government agencies. For-
      profit businesses and government agencies MAY NOT USE
      THIS PROGRAM without obtaining a license from the
      author, Hafthor Stefansson.

    * This program may be electronically distributed as
      long as:
      1) it is distributed as the original HSD169.ZIP
         archive, and
      2) it is NOT distributed as part of another package,
         or collection (except for Walnut Creek's CD-ROM)
         and
      3) NO CHARGE is required for users to download the
         original, unmodified HSD169.ZIP archive.

    * This program may not be modified, or reverse
      engineered other than for personal use. Modified
      versions may not be sold or distributed.

    * This program comes with NO WARRANTY either express or
      implied. The author bears no responsibility for
      damage occurred or data lost whether it is a direct
      or indirect result of use this program.

- end of legal agreement

-[ Description ]-------------------------------------------
   It's really nothing spectacular. It's just a directory
program that has evolved into something that I, and a few
friends, have become dependant on.

-[ Usage ]-------------------------------------------------
   99% of the time, it's just D. But occasionally you'll
want something different.
   First of all you can give D a drive, path, and/or
filename or mask. This is done in the same manner as you
would do for DIR.

   Example: D A:\DOC\*.TXT - displays all the files with
                             the TXT extension in the DOC
                             directory on the A drive.

   Additionally, you can give multiple file specifications,
including other masks, directories and/or drives.

   Example: D *.TXT *.DOC - displays all the files with the
                            TXT or DOC extension in the
                            default directory.

   Additional file specifications are based from the prior
file specification.

Example: D \ LANG\*.TXT QC251\*.EXE - shows the following:
 * all files in the root directory,
 * all the files with the extension TXT in the \LANG
   directory,
 * all the files with the extension EXE in the \LANG\QC251
   directory.

   Note that only drive space data (bytes total, bytes
free) are shown for the first drive specified.

   There are a number of options for D which are specified
through command line switches. These switches are preceded
by a - or a / and are compoundable.

   You can have anywhere from 2 to 6 columns. The 2 column
one is the most descriptive and shows the filename, size,
date and time. The 3 column one just shows the filename and
size. The 4 column option gives the filename, and the file
size. All the formats that show size automatically use
kilobytes, megabytes or gigabytes if the size is too big.
The 5 and 6 column options just show the filename.

   Example: D /4 - displays the current directory in the
                   four column mode.

   There are a series of options that are simply on or off.
If the option is specified, it does the opposite of what it
would have done without that option being specified. In
other words, if D normally shows your directory sorted, the
/Q option would cause D to show the directory unsorted.

   Option  Description
   ------  ------------------------------------------------
     /R    Read-only files displayed in a different color
           (red)
     /S    Show system/hidden file (yellow)
     /V    Show volume labels (green. only appear in the
           root directory)
     /D    Show . and .. files (white. actually they are
           directories)
     /Q    Sort directory (why Q? Hmmm... Quicksort maybe?)
     /O    Sort order ascending
     /P    Presort by file type
           (Volume Labels, Hidden/System files, director-
            ies, read-only files (if in different color,
            see /R), and then just regular files.)
     /T    Background subdirectory totaling

   Additionally, you may add a + or - to the option to
force it on or off. /Q+ would force D to always show the
directory sorted, no matter what it was configured for.
Normally, this would only be useful in batch files where
the present configuration of D may not be known.

   /T is quite handy if you want to quickly find out which
directories are chewing up all the hard disk space. Just go
to the root directory and type D /T. Where you used to see
<DIR>, you'll instead see how much space all the files in
that directory take up, including the subdirectories
beyond. This number does not include file slack -- only the
total of all the file lengths. You can also press Alt+T
while D is running to do this as well. Note that the
directory displays before the subdirectories are totaled,
which happens as a background task.

   As mentioned above, D can sort the directory. The /K
option allows you to select what D sorts the directory
display by.

   Option  Description
   ------  ------------------------------------------------
    /KF    Sort by filename, extension.
    /KE    Sort by extension, filename.
    /KS    Sort by size, filename, extension.
    /KD    Sort by date, time, filename, extension.

   Since D can shows dates and times, and since I'd like to
believe that it has international appeal, several date and
time formats are available. Note that invalid dates (such
as 15-31-2107) and/or times (such as 31:63:62) are flagged
with bright magenta. Many date/time errors are a result of
the seconds being above maximum, so you may have to use the
/I! switch to see the actual problem.

   Option  Description                  Sample
   ------  ---------------------------  ---------------
    /I0    U.S. Mo-Dy-Yr, 12 hr          4-01-94 12:00a
    /I1    U.S. Mo-Dy-Yr, 24 hr          4-01-94  00:00
    /I2    U.S. Month Dy-Yr, 12 hr      Apr01-94 12:00a
    /I3    U.S. Month Dy-Yr, 24 hr      Apr 01-94 00:00
    /I4    Euro. Dy-Mo-Yr, 12 hr         1-04-94 12:00a
    /I5    Euro. Dy-Mo-Yr, 24 hr         1-04-94  00:00
    /I6    Euro. Dy-Month Y, 12 hr      01-Apr94 12:00a
    /I7    Euro. Dy-Month-Y, 24 hr      01-Apr-94 00:00
    /I8    Jap. Yr-Mo-Dy, 12 hr         94-04-01 12:00a
    /I9    Jap. Yr-Mo-Dy, 24 hr         94-04-01  00:00
    /I!    Full. YearMoDy HrMnSc        19940401 000000

   You can also have D reset the video mode before display-
ing the directory.

   Option  Description
   ------  ------------------------------------------------
     /M    Display the directory in the current video mode.
     /M+   Force to 80x25 color before displaying.
     /M-   Force to 80x25 black/white before displaying

   If you add to any of the above options a C, D will store
that option to be used by default.

   Example: D /C3T+ - permanently configures D to show 3
                      column directories with subdirectory
                      totaling by default. (of course, you
                      can still override any defaults)

   D has two more options that are not permanently config-
urable.

   Option  Description
   ------  ------------------------------------------------
     /F    Shows only files (no subdirectories are shown)
     /U    Force to interactive mode, even if only one page

   If the directory has more files than can fit on one
page, or if the /U command line switch was used, D will
pause. Various keys can be pressed to do different things
here. These keys also work during background subdirectory
totaling (/T).

    D Key   Action taken
   -------  -----------------------------------------------
    ESCAPE  quit D
    ENTER   next page
    SPACE   <same>
    F1      Help
    PGDN    next page
    PGUP    previous page
    UP      show one more file from the prior page
    DOWN    show one more file from the next page
    HOME    go to the first page
    END     go to the last page, but display as many as
            possible
    Alt+2   Switch to 2 column mode
    Alt+3   Switch to 3 column mode
    Alt+4   Switch to 4 column mode
    Alt+5   Switch to 5 column mode
    Alt+6   Switch to 6 column mode
    Alt+Q   Toggle sorting on/off
    Alt+K   Cycle through sort modes (name,ext,size,date)
    Alt+P   Toggle presorting on/off
    Alt+O   Toggle order forward/backward
    Alt+I   Cycle through date formats (see /I)
    Alt+W   Write current directory view to a file
            (D!FILLST.TXT)
    Alt+T   Total up subdirectories

   Pressing any other key will cause D to abort without
flushing that key out of the keyboard buffer. This is
mainly so if you press D in a big directory out of nervous
habit (like I do), and then just start typing the next
command, you won't look up to find yourself stuck in D, or
with the first letter of your command missing.

   All the D keys, except F1, SPACE, ENTER, and ESC are
navigation keys. If you use any of these keys, D will not
automatically end when the last page of the directory is
displayed. If you just use ENTER or SPACE, D will return
you to the command line after showing you the last page,
so you won't be able to go back using the PGUP key or
change display or sort modes.

   Something to note on the Alt+W key is that it always
appends to a file called D!FILLST.TXT in your current
directory, which is not necessarily the directory you are
viewing. This was done primarily to avoid read-only media
problems, like CD-ROMs. To get a file that has the contents
of a CD-ROM, you can just switch to the C: drive and type
D D:, for example. Then, pressing Alt+W will write to the C
drive. Something else to note is that Alt+W writes out the
directory with the same sort and date format settings as
are on-screen.

-[ Support ]-----------------------------------------------
   Sorry, there is no support. Hey, what do you expect from
what is usually a free program? If you have questions,
comments, suggestions, or bug information, you may send
them to hafthor@usa.net and I will look it over, but I can
not promise you a response, but I certainly will read it
and take it under advisement.

-[ History ]-----------------------------------------------
02-04-90
   Created. (in a mad programming fury)
   Version 1.00.00 Ready for release.
02-05-90
   Added File Masking.
   Version 1.10.00 Ready for release.
02-06-90
   Added 6 Column Option.
   Added Sub-directory Size Calculation. (/T)
   Added Files Only Flag (No Subdirectories). (/F)
   Version 1.20.00 Ready for release.
02-06-90
   Added Total Directory Read-Ahead.
   Added QuickSort Option. (/Q)
   Version 1.30.00 Ready for release.
02-12-90
   Added KBHIT() Display Pause. (doesn't flush invalid key)
   Version 1.31.00 Ready for release.
03-13-90
   Made SetVideoMode Selectable. (/M)
   Fixed Path Parsing Bug.
   Version 1.40.00 Ready for release.
05-03-90
   Fixed a minor directory bug.
   Version 1.41.00 Ready for release.
06-05-90
   Auto Palette Change.
   Attempt to Fix Path Parse problem on Novell networks.
   Version 1.42.00 Ready for release.
04-13-91
   Added Sort Options. (Filename, Ext, Size, DateTime)
   Shrunk buffer element size
   Intelligent memory allocation
   Improved date & time print routine.
   Selectable presort by file type, and reverse sort.
   Version 1.50.00 Ready for release.
06-29-94 (yes, it's been >3 years since the last change)
   Fixed some config bugs
   Added > 80 column support. (well sorta)
   >1G support.
   International Date/Time Support.
   Always shows totals line.
   Navigation keys supported.
   Version 1.60.00 Ready for release.
06-30-94
   Got rid of pesky flicker.
   Version 1.61.00 Ready for release.
12-31-97 (another really long time since last change)
   Added online display/sort mode change ability.
   Added new "full" date format.
   Shuffled display around a little to accommodate >1G
   drives and really long path names.
   Display continually updates while waiting for keys (to
   update clock)
01-02-98
   Added compound command-line switch ability.
   Added write directory to file feature.
   Version 1.62.00 Ready for release.
01-02-98
   Added background subdirectory totaling.
01-05-98
   Version 1.63.00 Ready for release.
01-07-98
   Reduced screen cursor flicker.
   Version 1.63.01 Ready for release.
01-09-98
   Support for a greater number of files.
   Version 1.63.03 Ready for release.
01-12-98
   Improved subdirectory totaling screen updating.
   Made /T permanently configurable.
   Fixed a /T related paging bug.
   Version 1.64.00 Ready for release.
01-12-98
   Made all size related variables unsigned longs (up to
   4GB).
   Version 1.64.01 Ready for release.
07-02-99 (a year an a half since last date with D)
   Made size related variable unsigned triple words (up to
   256TB).
   Code was examined (but not tested) for Y2K related
   issues. Non found.
   Four column now shows size in bytes, if it will fit.
   Version 1.65.00 Ready for release.
07-03-99
   Made size related variables unsigned quad words (up to
   16 exabytes).
   Supports up to 16,000 files.
   Version 1.66.00 Ready for release.
07-05-99
   Added support for multiple file specifications.
   Improved .., ... handling.
   Version 1.67.00 Ready for release.
07-20-99
   Added support for Win95 Extended Free Space information.
   Version 1.68.00 Ready for release.
02-06-00
   Shows invalid dates/times in bright magenta.
   10th Anniversary Edition
   Version 1.69.00 Ready for release.

-[ Future ]------------------------------------------------
   Well, I really can't tell you. I would have never
guessed that I'd be messing around with this program for
this long. I do have a short list of stuff I'd like and
have been asked to add, so here it is:
* Win95 Long file name support
* 1-column mode with more Win95 file data
* Add hot keys to handle turning on/off the other command-
  line switches (such as /R /S /V /D /M /F) and maybe a
  Alt+C to store current config to D.
* Support for even more files. Presently, D can handle
  about 16,000 files in view.
* Allow D to work inside ZIP files, and maybe other archive
  types.
* Screen clear/scroll switch.
* Display using stdout w/ ANSI or w/o switch.
* Display files across/down switch.

-[ About the Author ]--------------------------------------
   Q: Hafthor Stefansson?!? How do you pronounce that?
   A: H(ah)F'  THOR
      (ah like in fAther, THOR as in Thor's hammer)

      STEF'  eNS  SON
      (STEF like it's spelled, not like STEVE)

   Q: Where does a name like that come from?
   A: Reykjavik, Iceland.

   Q: Iceland, isn't that near Alaska?
   A: No. It's pretty much directly north of the U.K.

   Q: How do I contact this Hafthor Stefansson person?
   A: hafthor@usa.net on the Internet. Currently, I'm
      living in Mesa Arizona, but who knows for how long.
      The e-mail address should stay the same.

   Q: The legal stuff says I can't use D without per-
      mission. How much does permission cost?
   A: Depends. Rather than having a hugely complex and
      possibly not-all-inclusive legal statement, I'd
      rather just have biz and gov ask for it. There are
      certain biz and gov offices that I may not be able
      to give permission for at all, others may be granted
      free license. It just depends.
