[Wersting] D[ir] v1.26
===========================================================================
Copyright (c) 1995-1997 Magnus Bck
http://www.geocities.com/SiliconValley/5159/d.html
baeck@swipnet.se
===========================================================================

1.  Purpose
2.  Syntax
3.  Switches
4.  WDIRCMD enviroment variable
5.  Color coding
6.  Revision history
7.  Lacking features
8.  What users say
9.  Acknowledgements
10. Downloading updates
11. Notes on distribution

===========================================================================
1. Purpose
===========================================================================

[Wersting] D[ir] (abbreviate to wDir or D) replaces the normal DOS DIR
command for listing directory contents. It provides nearly full
compatibility with DIR (no need to relearn), but also adds numerous
features that normally requires special applications. As for now, it's
quite notably slower than DIR, but this will be fixed in later releases.

===========================================================================
2. Syntax
===========================================================================

D.EXE [<files>] [<switches>] [@<configfile>]

These parameters may appear in any order on the command line. Switches are
always preceded by a slash, and can be overridden by placing a dash after
the slash, e.g. /-D disables a previously set /D. <files> contains a
directory and/or file mask for the files you want to display. There are
known problems with the parsing of the parameter, so if you have any
suggestions about how to do it in a fool-proof way, please tell me about
it.

You can save your switches to a file and then use @<configfile> to use
those parameters as defaults. Specify this in the WDIRCMD enviroment
variable in your AUTOEXEC.BAT. The configuration file is read every time D
is executed, so make sure it resides on a fast media. Parameters can also
be placed directly in the enviroment variable. You can use this parameter
on the command line too, but that's pretty awkward. From version 1.10 and
on, you can place your own comments in the configuration file by placing a
grid (#) as the first character of a line. The maximum size of the
configuration file is 4 kB.

===========================================================================
3. Switches
===========================================================================

In alphabetical order

/?
Displays a help screen with a short command reference and color coding
guide.

/43
If you're using /SC and running 43 line mode, use this switch to make sure
the page breaks are made in the correct places.

/A
Selects which files are to be displayed, regarding their file attributes.
You can optionally specify one or many of the following parameters;
specifying only /A will display all files, no matter what attributes they
may have.

+---+-------------------------------------------------+
| A | Files with the archive attribute are displayed. |
| R | Read-only files will be displayed.              |
| H | Hidden files, ditto.                            |
| S | System files, ditto.                            |
| D | Directories, ditto.                             |
+---+-------------------------------------------------+
Table 1: Parameters to be used with /A

If you precede the parameter with a dash ("-"), you'll have an opposite
effect and display all files except the ones specified.

Example

    /AH-R

This will display all files that are hidden, but not any read-only files.

/ARJ
Displays the contents of ARJ archives in the same way as /ZIP, /LZH and
/RAR. There is no support for file attributes inside the archives.

/B
Strips all file information except the name and extension and displays one
file per row. No header or summary information is displayed.

/BA
Shows how many bytes are allocated for every directory. This is always a
multiple of the cluster size. Also, the waste percentage, i.e. how much
space is lost due to the clusters, is displayed.

/BMP
Displays the height, width, color depth and any compression algorithm used
of all Windows bitmaps (*.BMP, *.RLE). The information is displayed after
any attributes if /T is set, but before any long filename.

Example

    640x480x256 RLE8

/BW
All color-coding is switched off and everything is displayed in black and
white.

/CL:<extension>:<colors>
Allows the user to fully customize the colors used for different
extensions. <extension> is of course the extension to effect (however,
there are special cases, see below) and <colors> is a list on the form
<foreground>[,<background>][,B].

Some extensions are handled differently; files compressed with Microsoft
Compress (i.e. has a _* name) are defined with _. To set the default
colors for the whole application, use *, use LFN to select the color for
long filenames, and finally, use DIR for directories.

Note: Blinking text sometimes displays non-blinking when running the
DOS-prompt in a window session under Windows 95. Also, some color
combinations only work if you're using /D (as opposed to ANSI colors).

Examples

    /CL:DIR:15,2

Display directories as white on green.

    /CL::8

Display files without extension as dark gray.

    /CL:*:14

Set the default color to yellow.

    /CL:TMP:15,4,B

Display temporary files as blinking white on red.

/CLS
Clears the screen before doing anything.

/DA
Periods, as opposed to spaces, are used as placeholders for attributes
that aren't set. This switch is not relevant if /T isn't specified.

/DF<s>
Selects the date format to be used, defaults to dd-mm-yy. Allowed format
strings are yyyy, yy, mm and dd. No syntax checking is performed, that's
up to you.

Example

    /DFyyyy.mm.dd

/DIR
Use this switch to ensure complete DIR compatibility, if that's crucial.
These are the changes when using /DIR:

  * The columns are a bit further apart with /DIR.
  * The "Bytes free" line after every directory isn't displayed when using
    /S.
  * The cluster size of compressed drives is based on the physical cluster
    size of the drive and not the internal. If you want the logic cluster
    size you must be running under Win32 GUI.

Haven't checked so much yet, please report any incompatibilities you'll
find to me.

/F50
Forces the screen into 50 line mode (43 lines for EGA screens).
Automatically pauses before going back to the previous video mode.

/FLIC
Displays the width, height, color depth and number of frames for Autodesk
animations (*.FLI and *.FLC). Width, height and color depth is always
320x200x256 for FLI files, though.

/GIF
The width, height, color depth and version of Compuserve GIF images is
displayed.

Example

    640x480x256 GIF89a Intr

This is a 640x480 256 color interlaced GIF89a bitmap.

/I
If you think the . and .. directories just fill your screen without
reason, this might be useful. The switch takes one ore more parameters:

+---+---------------------------------------+
| L | Ignores them in the directory listing |
| S | Ignores them in the summary           |
+---+---------------------------------------+
Table 2: Parameters to use with /I

You may specify them both if you like. The default is to ignore them in
the summary.

/JPG
Displays the width and height of JPEG (*.JPG) files. Color depth isn't
relevant, all JPEGs are 24 bit.

/L
All filenames (though not long filenames) are converted to lower-case. Any
letters above ASCII 127 aren't affected.

/LFN
The long filenames introduced in Windows 95 are displayed in the colors
specified for 'LFN' (see color coding) last on the line. If the name won't
fit on the line and if you're using direct display write (with /D), it
will completely move on to the next line (i.e. LFNs aren't wrapped). For
the long filesnames to work, you must be running in Windows 95 GUI mode,
thus it will not work if you're running in plain MS-DOS mode.

/LWN
Provides the same functionality as /LFN, except that it only displays the
long filename when it differs from the standard name. It's case-sensitive,
if the original name is 'WIN.INI', the long filename will be shown if it
is 'win.ini'. This switch will eliminate screen clutter caused by all LFNs.

/LZH
This switch will display the contents of LZH archives (created by LHA). As
with all archives, the contents is indented.

/NIC
When archives (ZIP, LZH and RAR) are found in a directory, the first bytes
of the file are checked to see if it really is a valid archive. If you're
DIRing a diskette, this might take a while. /NIC (No Integrity Check) will
prevent this from happening. If the archive is recognized, the file will
be displayed in color color chosen for that extension, if not the default
colors will be used. See color coding.

/NOWARN
No warnings will be issued with this switch set. These are the occasions
when warnings will occur:

  * If more than one file path and/or file mask i specified. All
    parameters not beginning with slash ("/") or at ("@") are considered
    to be file masks. The second file mask will be ignored and the first
    one will be used.
  * When an invalid parameter to the /O is used. Only G, N, E, D and S are
    valid. That parameter will be skipped and the parsing will continue
    with the next parameter to the /O switch (if there is one).
  * Ditto, if an invalid parameter to the /A is used. Only A, D, R, H and
    S are valid. That parameter will be skipped and the parsing will
    continue with the next parameter to the /A switch (if there is one).
  * If both /W and some archive switch are used, a warning informs that
    the archive contents won't be displayed.
  * If /LFN is set, and your DOS version doesn't support long filenames.
  * When two conflicting switches are set, i.e. if you specify both /OG
    and /O-G. The second switch will be ignored.
  * When a ZIP archive is too big, this usually happens with archives
    larger than 1000 files.

/O
Selects sord order to use, and can be one or more (can only be more than
one with G ) of the following:

+---+------------------------------------------------------------------+
| G | Groups the directories together in the beginning of the listing. |
| N | Sorts ascending (A-Z) by name.                                   |
| E | Ditto by extension.                                              |
| D | Ditto by date, oldest first.                                     |
| S | Ditto, by size, smallest first.                                  |
+---+------------------------------------------------------------------+
Table 3: Parameters to use with /O

By preceding a letter with a dash ("-"), the sort order will be reversed
to descending.

/P
The output will be paused for every screen and a key must be pressed to
continue.

/PCX
Displays the width, height and color depth of ZSoft PCX files.

/RAR
This switch will display the contents of RAR archives.

RDX[<c>]
Selects the thousand delimiter to use for file sizes. If this parameter is
omitted, a space will be the delimiter.

/S
All subdirectories to the directory to be displayed will be recursed
before displaying any output. A summary of all files found in all
directories will be displayed at the end of the listing.

/SC
Screen compatibility. On some systems, the number of lines is for some
reason not correctly detected, 25 lines is assumed even when running 43/50
line mode. /SC uses another method to detect the line count. The catch is
that it can't distinguish between 43 and 50 lines. Use /43 is you're
running 43 line mode.

/SN
This will display the serial number of the drive you're listing.

/T
The attribute(s) of the file will be displayed after the time stamp. The
attributes are by default separated by spaces, but can be separated by
dots/periods with the /DA switch.

/TF<s>
Selects the time format to be used, defaults to 12hr hh:mm. Allowed format
strings are hh, mm and ss and p. Specifying p will use 12hr mode and
insert pm/am at that point. No syntax checking is performed, that's up to
you.

Example

    /TFhh:mm.ssp

/TGA
Displays width, height and color depth of TrueVision TGA images (*.TGA) in
the same manner as all other image files.

/W
Only the filename and extension will be displayed in five columns.
Directories are displayed in brackets ([like this]) to clearify.

/WAV
Displays the sample rate in kHz and bit count for Windows Wave Sound
(*.WAV).

/ZIP
This switch will display the contents of ZIP archives. If the ZIP is too
large, you are warned about this and the rest of the archive is skipped.
In the summary, you'll be informed how many of the files were displayed
and the total file count. Normally, about 1000 files will display without
memory problems.

===========================================================================
4. WDIRCMD enviroment variable
===========================================================================

To make D easier to customize, you may use the WDIRCMD enviroment variable
to set default switches. It works in the same way as the standard DIRCMD
variable for DIR. DIRCMD is checked by D, too. This is the order in which
the parameters get parsed:

  1. DIRCMD enviroment variable
  2. WDIRCMD enviroment variable
  3. Any configuration file specified in WDIRCMD
  4. The command line
  5. Any configuration file specified on the command line

The best thing to do is to specify a configuration file in WDIRCMD. That
way, you don't have to reboot to change the default behaviour. However,
with this approach, the config file will be opened and read every time you
call D, so make sure it resides on a fast drive (RAM drive would be ideal).

===========================================================================
5. Color coding
===========================================================================

The colors used to mark different extensions is fully customizable with
the /CL switch. These colors can be used:

+---------------------------+------------------+
| Foreground and background | Foreground only  |
+---------------------------+------------------+
| 0 Black                   | 8  Dark gray     |
| 1 Blue                    | 9  Light Blue    |
| 2 Green                   | 10 Light green   |
| 3 Cyan                    | 11 Light cyan    |
| 4 Red                     | 12 Light red     |
| 5 Magenta                 | 13 Light magenta |
| 6 Brown                   | 14 Yellow        |
| 7 Light gray              | 15 White         |
+---------------------------+------------------+
Table 4: Colors and their corresponding numbers

===========================================================================
6. Revision history
===========================================================================

1.26 (July 1st 1997)
  * /P now works with /W.
  * Faster display with /P and many files. The screen is cleared is the
    number of files remaining will fill the screen again.
  * /S works with directories that are hidden.
  * The name of the filesystem is shown after the drive letter, however not
    with /DIR specified.
  * Still after v1.25, some JPEG images didn't have the correct width and
    height. This should now be corrected.
  * 12:00-12.59am previously became 0:00-0:59. Fixed.
  * .lha files display just like .lzh with /LZH.
  * The path is now searched for the configuration file if no path is given
    and it isn't found in the current directory.
  * /LWN is no longer used with /LFN, it's used separetely. Specifying
    '/LWN' has the same effect as '/LFN /LWN' previously had.


1.25 (June 6th 1997)
  * '/B /S /-LFN' now shows the full path.
  * /I now defaults to /IS, earlier no default value was used and the
    switch was ignored if no parameter was specified.
  * '0 dirs' is displayed instead of '0 dir'.
  * No leading zero in AM times.
  * Empty extension or name always counts as the * wildcard.
  * New pause message colors, black on white.
  * * wildcard allowed in beginning of file mask.
  * JPEGs display correctly, earlier some images had the wrong dimensions.
  * The cluster size of compresed volumes is set to 512 bytes if running
    under Win32 GUI and unless /DIR is active.
  * Warnings display correctly.
  * Some bug fixes in the help screen.
  * Typos and errors in documentations fixed.
  * User customizable colors with /CL.
  * /O now has better DIR compatibility.

1.20b (January 25th 1997)
  * Switches no longer have to be separated with spaces, '/S/P' is now
    valid. Improves DIR compatibility.
  * On some systems, the number of lines isn't correctly detected, 25
    lines is assumed even when running 43/50 line mode. /SC has been
    added, it uses another method to detect the line count. The catch is
    that it can't distinguish between 43 and 50 lines. Use /43 is you're
    running 43 line mode.
  * Displays '0 files' instead of '0 file'.

1.20a (December 12th 1996)
  * Small GIF images don't cause error messages any more.
  * The "x% wasted" previously displayed completely wrong numbers with big
    directories, that has been fixed.
  * The complete path isn't always displayed with /B, only when /S is
    used.
  * Summary information is no longer displayed when the switches /B and /S
    are active.
  * The "Bytes free" line isn't displayed with /S when DIR compatibility
    switch /DIR is active.

1.20 (December 6th 1996)
  * Direct video write is now optional. Output now goes to stdout,
    enabling ections. ANSI colors are used when writing to the screen.
  * /DIR switch to ensure complete DIR compatibility, as some anomalies of
    DIR are a bit illogical, but could be needed for compatibility.
  * Time/date format can now be specified exactly as you want it. Defaults
    to American style dd-mm-yy and 12hr hh:mm.
  * /RDX to select the thousand delimiter to use for file sizes. Defaults
    to comma.
  * Command line file parsing now works with all path and extension
    combinations.
  * /B now displays the full path name for the files displayed.
  * /A is now compatible with DIR.
  * _?? files are now displayed as compressed instead of ??_.
  * Code further optimized.

1.10c (October 17th 1996)
  * File sorting performance increased by 85% due to a completely
    rewritten sort routine.
  * ZIP files that are too large don't result in a heap overflow and a
    program crash.
  * /P works even better.
  * Ctrl+S and Ctrl+C now works when listing archive contents.
  * Various other smaller bug fixes (e.g. some embarrasing documentation
    errors).

1.10b (September 4th 1996)
  * Long filenames are disabled when running in native MS-DOS mode under
    Windows 95 since they have caused some systems to crash.
  * TrueVision TGA image support with /TGA.
  * /P now works correctly with archives.

1.10a (August 5th 1996)
  * Memory management is better, no more heap overflow when displaying a
    large amount of files, e.g. when using /S from the root.

1.10 (July 31st 1996)
  * The contents of ARJ archives are now displayed in the same way as ZIP,
    LZH and RAR archives. Activated with (surprise) /ARJ.
  * /LWN added. Prevents screen clutter by not displaying all long
    filenames.
  * The space allocated for a directory is shown with /BA.
  * Fixed bug that caused the file handles to run out when displaying
    archives.
  * Comments are allowed in configuration files.
  * Fixed bug the bug that sometimes placed one directory last in the
    listing, even when /OG was specified.
  * Shows file information on WAV and FLI/FLC files.

1.00a (June 19th 1996)
  * PCX images are supported with /PCX.
  * TGZ archives and Lempel-Ziv compressed ??_ files are now displayed in
    cyan like all other archives.
  * Various bug fixes and optimizations.

1.00 (May 19th 1996)
  * ZIP files are now displayed correctly. Previously, archives containing
    files with long filenames and/or directories were displayed as empty.

0.99e (April 24th 1996)
  * The date of files in ZIP arhives wasn't displayed correctly, which was
    now fixed.
  * Help page slightly changed with a new e-mail address and this URL
    added.

0.99d (March 28th 1996)
  * JPEG (*.JPG) support. Width and height is displayed. Activated with
    /JPG.
  * Support for the long filenames in Windows 95 through /LFN.
  * /43 is no longer needed, D keeps track of the number of lines used.

0.99c (March 3rd 1996)
  * A minor bug fix with the parameter parsing.

0.99b (March 2nd 1996)
  * Full GIF support with /GIF.
  * Serial number support with /SN.
  * Predefined switches can be put in a separate configuration file with
    @<configfile>.
  * The directories . and .. can now be removed with /I.
  * The 8087 emulation library was removed, reducing EXE size with about
    10 KB.
  * /PD was renamed to /DA.

0.99a (February 20th 1996)
  * A scroll bug was removed.
  * /S doesn't only displays summary information when there is a file
    match in a sub-directory. Earlier, "0 files, 0 bytes ..." was
    displayed for every directory searched (very annoying when doing a /S
    in the root direcotory.
  * ZIP archive support with /ZIP. No attributes are displayed yet, and
    any subdirectories in the ZIP aren't displayed correctly.
  * LZH archives are correctly identified.
  * The file sorting algorithm was optimized and the performance increased
    20%.

0.99 (February 6th 1996)

The first public release.

===========================================================================
7. Lacking features
===========================================================================

Nothing's even close to perfect. These features will (hopefully) be added
to D:

  * Novell Netware volume name support.
  * Faster sort routine.
  * More image formats (e.g. TIFF) and sound formats (AU).
  * The <TITLE> tag of HTML files will be shown to make it easier to
    identify e.g. files in the Netscape cache directory.
  * Option to add more file extensions that are to be color coded.
  * Progress meter when sorting files.
  * Ability to have larger configuration files than 4 kB.

I'm not planning to include these features:

  * Support for /C to display compression ratio of the files on compressed
    drives. If anyone knows how to do this, please let me know.

===========================================================================
8. What users say
===========================================================================

"Instead of typing 'DIR,' try 'D' instead--you'll like what you see."
-- ZDNet Software Library

"...'D' is the finest and most useful piece of software I have ever used,
and you can can damn-well quote me on that!"
-- Mister Llama 

===========================================================================
9. Acknowledgements
===========================================================================

  * Stan Brown, from whom I've received many, many pages with useful bug
    reports. 
  * Dean Thompson, whose suggestions led to half of the new features and
    fixes in v1.20.
  * Matt Shickell, for some bug reports and suggestions for new features.
  * Jon Hollstrm, who gave me the idea for this application in the first
    place back in 1995.

===========================================================================
10. Downloading updates
===========================================================================

If you want to put [Wersting] D[ir] up on your FTP site let me know and
I'll include your site to the list. If you want any updates made to D by
e-mail, fill out the [Wersting] D[ir] Update-by-Mail form found at
http://www.geocities.com/SiliconValley/5159/d.html.

  * WDIR126.ZIP (38 kB) from GeoCities, U.S.A.
    http://www.geocities.com/SiliconValley/5159/wdir126.zip
  * WDIR126.ZIP (38 kB) from Tele2/Swipnet, Sweden.
    http://home2.swipnet.se/~w-22337/wdir126.zip
  * WDIR126.ZIP (38 kB) from Simtel.Net, U.S.A., by HTTP or FTP.
    http://www.simtel.net/pub/simtelnet/msdos/dirutl/wdir126.zip
    ftp://ftp.simtel.net/pub/simtelnet/msdos/dirutl/wdir126.zip

===========================================================================
11. Notes on distribution
===========================================================================

[Wersting] D[ir] is freeware and may be freely distributed on any
electronic media as long as nothing is charged for it, except for nominal
copying costs. If you upload it to an FTP och WWW site or some other
service, such as BBSes (which I do encourage), I would appreciate if you'd
notify me.

[End of README.TXT]
