
                         NewDIR, Version 1.89
                        NewDIR32, Version 2.00

                 The Ultimate Color Directory Program


                              Written by:

                         Daniel D. Miller
                         4835 Coco Palm Drive
                         Fremont, CA  94538

                      Email: derelict@home.net


This program, NDIR.EXE, and its associated utilities are hereby released 
as Freeware, though I retain the copyrights on them.  Please feel free 
to distribute it anywhere that it might be useful!!

***************************************************************************

                   NDIR.EXE - The directory lister.

This program is a color directory lister with many options.  In addition
to the standard file-display options, it also offers special display
options to:

   ->  Display drive summaries for all disk drives in your system
   ->  Display a complete, recursive directory tree that shows summary
       information for all subdirectories on a drive.  *NO OTHER*
       color directory lister shows as much information in the TREE
       view as NDIR does!!
   ->  Batch mode: enables user to create batch files from lists
       of filenames in a directory.

A full-powered configuration program is included with NDIR.  In fact,
TWO configuration programs are included with the two NDIRs in this
distribution:  16-bit and 32-bit versions.  All this for the cost of
a warm thought sent in my general direction when you use NDIR!!

***************************************************************************

                                Installation

The only installation required by NDIR is to place all of these files
somewhere in your path, so they can be located when you run them from
a DOS prompt.

***************************************************************************

History of changes:

Certainly, the biggest change in this distribution is the release of
the long-awaited 32-bit versions of the programs!!  These even work
(mostly) with WinNT 4.0.  They, of course, have not been tested on
NT5 because I don't have access to any such system.

NDIR32 and NDIRMOD32 both work fine on Win95 OSR2, Win98, and WinNT4.
NDIRMOD32 can be used with either NDIR.EXE or NDIR32.EXE, NDIRMOD can
only be used with NDIR.EXE.

There's still a small problem with determining the cluster size on
network drives from the 32-bit programs; I haven't yet figured out
that trick.  I use lookup tables for cluster size on all the other
OSs.  Sadly, since I can't make INT calls from 32-bit programs, I can't
call the Win95 functions that would give me this information (and they
don't work under NTFS anyway).

There were also a couple of trivial changes in the 16-bit programs,
but likely nothing that anyone really cares about...

See NDIR.REV for older revision history.

***************************************************************************
                Handling System/Hidden/Readonly files

NDIR can now display S/H/R files with a background color selected by
the user.  The foreground color is determined by the file attribute,
with the BRIGHT bit set, and a background color which is specified
by the user, via NDIRMOD.  The following table lists the foreground
colors for various file attributes:

        S  H  R         foreground color
      =================================================
        0  0  0      determined by file extension
        0  0  1      Bright Blue
        0  1  0      Bright Green
        0  1  1      Bright Cyan
        1  0  0      Bright Red
        1  0  1      Bright Magenta
        1  1  0      Bright Brown (Yellow)
        1  1  1      Bright White

***************************************************************************

                              NDIRMOD.EXE

NDIRMOD is a configuration program that allows you to change any of the
NDIR options, permanently, in NDIR.EXE.  It also allows you to add to or 
delete from the list of extensions which have special colors, as well 
as setting these colors.

***************************************************************************

         WHAT DOES NDIR DO THAT EVERY DIR LISTER DOESN'T ? ?

Here are some of the features of NDIR, a summary of which can be
obtained by typing NDIR -? :

- Long-filename support (MSDOS 7.00+)

- FAT32 support

- Full color file display.

- List executable files only (.BAT, .COM, .EXE) 

- Full control over display format 
  (pause-on-full-screen, clear-screen-before-listing, 
   select number of columns and amount of file info shown).

- File exclusion (list all files EXCEPT *.ult, for example).

- Full directory TREE, showing size of current directory
  as well as current directories PLUS subdirectories.

- Show ALL files, including read-only, hidden and system files.

- A separate configuration program, for customizing default options,
  as well as all color and extension settings.

- EGA 43-line support (50 lines on VGA).

- A "batch" mode which can assist you in creating batch files.


     WHAT DOESN'T NDIR DO THAT EVERY DIR LISTER DOES OR DOESN'T ? ?

Functions that are NOT supported (because I ran out of time before other
projects developed), but may be added if interest is shown, are:

- Compressed FAT32 drives are not reported correctly.  This will be added 
  if anyone tells me they are using disk compression; with huge disks so 
  cheap, I'm assuming nobody is paying the performance penalty.

- Support for global subdirectories; i.e., search for files across all
  subdirectories under current default. The framework for implementing 
  this is in place, but it would take a fair amount of work to finish 
  it, and I'm waiting to see if anyone cares.

- Ability to search for files with only a certain attribute or combination
  of attributes.

- Anything else that I didn't think of, and nobody's requested.

***************************************************************************

                 WHO ARE YOU ? ?  (who-who. who-who.)

I am a Software Engineer, living in Fremont, CA.  I started out as a
digital hardware engineer, but discovered that software is more fun!!!
I have professional experience with C (mostly), numerous assemblers, 
PASCAL, Visual Basic (but I got better), and DBASE III (don't laugh).  

NDIR and NDIRMOD were written in MS C++ version 8.00 and MASM 6.13,
with assistance from the excellent Spontaneous Assembly extended 
libraries.  These excellent libraries, unfortunately, are no longer 
available commercially, more's the loss.

NDIR32 and NDIRMOD32 were written in Visual C++ V6, with no after-market
libraries at all...

***************************************************************************

NDIR Command-Line switches
--------------------------

This is a list of the command-line switches supported by NDIR.

This list can also be obtained by typing 'NDIR /?'

USAGE:  NDIR <filespecs> -options or /options !<exclusions>
 
 OPTIONS                      FUNCTIONS
   -a *     List ALL files (hidden, system, read-only, etc.).
   -c *     Clear screen before listing.
   -p *     Pause on full screen.
   -m *     Minimize size of header and footer.
   -w *     Use special colors for system/hidden/readonly files.
   -d *     Display directory TREE (work with -s, -n (default), -r).
   -e       Sort by extension.
   -n        "   by name.
   -s        "   by file size, smallest first.
   -t        "   by Date, oldest first.
   -z        "   by DOS order (no sort).
   -r *     Reverse normal sort order.
   -1       Display one column,  with name/size/date/attr.
   -2          "    two   "   , with name/size/date.
   -3          "    three "     (short-filename form only)
   -4          "    four  "   , with name/size.
   -6          "    six   "   , with name only.
   -i       Display drive summary for all drives in system.
   -?       Display HELP screen.
   -x *     List executables only (.EXE,.COM,.BAT).
   -l *     Toggle long-filename enable flag (MSDOS 7.00+ only)
   -k *     Toggle color mode. (non-color mode is redirectable)
   -j *     Use standard ASCII (for redirection). (forces -k)
   -5 *     Switch to EGA 43-line/VGA 50-line mode.
   -o *     Display LAST_MODIFY (default) or FILE_CREATE date/time.
   -u *     List filenames in UPPERCASE.
   -v       Display distribution status and author information.
   -g *     List directories FIRST.
   -h *     List files horizontally.
   -f *     List files only (No directories).
 
   -b       Batch mode;  files listed in one column.
            (This format can be redirected to a batch file)
   ["string"  specifies a string BEFORE each filename (Batch mode)
   ]"string"  specifies a string AFTER  each filename (Batch mode)
 
 Define new extension color on command line (use equal sign):
 =.FAQ=2 means make all .FAQ files be color 2 (green).
 
NOTE: items with a * after the flag are TOGGLES
 
***************************************************************************
                     
NOTES on using command-line switches:
-------------------------------------
NDIR's functionality can be modified in three ways:

1. Type NDIR <options> as documented above.

2. Run the NDIRMOD program (supplied with NDIR) to permanently customize
   NDIR exactly the way you want it.  

3. Use the NDIR ENVIRONMENT VARIABLE to specify NDIR options.
   At the DOS prompt, type SET NDIR=-options
   This method is convenient when you wish to make temporary, on-the-fly
   modifications to NDIR's configuration, without running NDIRMOD.

   If NDIR.EXE is renamed to some other filename, the name of the 
   environment variable will change with it.  For example, if NDIR.EXE
   is renamed to N.EXE, you would use SET N=-options to set the 
   environment.


Order of interpretation for command options:

The environment variable will override any default options in NDIR.EXE.
Options typed on the command line will override both the default options
AND the options in the environment variable.

//****************************************************************

Notes on using Batch mode (-b) :
--------------------------------
The purpose of batch mode is to assist you in creating DOS batch files.
The output from NDIR in batch mode is a single-column list of the 
requested filenames, with no other information.  This output is written
using BIOS functions, so the output can be redirected to printer or file.

In addition, NDIR provides a method for inserting text before and after
each filename in the listing.  The LEFT square bracket ([) is used to
indicate a string PRECEDING each filename.  The RIGHT square bracket (])
is used to indicate a string FOLLOWING each filename.  This is easy to
remember if you think of the filename enclosed in 
square brackets ( [filename] ).  Then it's easy to remember which string goes
in front of (filename) and which goes after.

Let's look at some examples of NDIR batch-mode commands.
Assume that the following files are in the current subdirectory;

NDINSTAL.C          NDINSTAL.EXE
NDIR.C              NDIR.DOC
NDIR.EXE            NDIR.HLP
NDIR.TXT            NDIRMOD.C
NDIRMOD.EXE         NDIRSRC.BAT
NDIRZIP.BAT         NUPDATE.BAT

Here are some sample commands and their outputs:
------------------------------------------------

   NDIR -B *.BAT

This will list all BAT files, in single-column, with no other information.
The output looks like:

ndirscr.bat
ndirzip.bat
nupdate.bat

------------------------------------------------

   NDIR -B *.TXT *.DOC ["PRINT " >printit.bat

The output from this command will be a list of all DOC and TXT files,
preceded by "print ", and these lines will be written to a file 
called PRINTIT.BAT .  The contents of PRINT.BAT will be:

print ndir.doc
print ndir.txt

------------------------------------------------

   NDIR -B *.EXE *.BAT ["COPY " ]" B:" >copyexec.bat

This will list all EXE and BAT files, preceded by 'copy ' and followed by ' b:'.
The output of NDIR will be written to COPYEXEC.BAT.
The output:

copy ndinstal.exe b:
copy ndir.exe b:
copy ndirmod.exe b:
copy ndirsrc.bat b:
copy ndirzip.bat b:
copy nupdate.bat b:

------------------------------------------------
