---------------------------------------------------------------------------
                               MkIndex.exe
---------------------------------------------------------------------------
                      Directory documentation utility
                                  V1.00
                          (c)Pekic Zoltan, 1995.
---------------------------------------------------------------------------

1. Purpose
   
   It's a common practice on anonymous FTP sites to put a simple text file
into each download directory, containing the date, size, name and a short de-
scription for every file available. I'm kind of administering a small NT based
site (visit us!, ftp: or http://161.53.40.11) with files frequently changing,
and being unable to locate such an utility on the net (?), I wrote a little NT
console application for my own convenience.   


2. How does it work?

   Invoking MKINDEX without any command line arguments will create an INDEX.TXT
file in the current directory. For each file in the directory, the following
entry is generated in the "index" file:

yymmdd s filename ;

yymmdd   ... File's creation / last change date 
s        ... Length in bytes
filename ... Full length (NTFS) or 8.3 (FAT) filename, with preserved case

   This basic structure of the file can be enhanced with comments about each
file after the trailing semicolon (;) ,or comment lines appearing anywhere
in the file following the # or ; characters.  

   Reinvoking MKINDEX in a directory with an index file already existing will
do the following:

-  MKINDEX will read in the complete index file.
-  MKINDEX also reads in all info about files currently in directory.
-  The two list are compared, files no longer in directory will be removed
   from the index file together with its comments, and new files will be
   appended to the index with blank comment field. If there is a file that 
   only changed its size or length, the index will be updated accordingly,
   with comment field left unchanged. 
-  All comment only lines are preserved.
-  The updated index file is written back.
 
   The entries in the index file are by default sorted by file date (latest
on the top - don't we all look first for those ?), but this can be changed.
Please note that sorting 1000 or more files with the current sluggish bubble
sort can take quite a while.

 The following command line options are supported in version 1.00:

 MKINDEX [/S] [/D|/R] [/A[:]HS] [/O[:]N|S|D[+|-]] [Path] [FileName] [NewFileName]

 /S          Recurse subdirectories. The index file will be generated 
             in the specified (or current) directory and all its sub-
             directories, no matter how deep. 

 /D          Delete index file(s). Useful in combination with the /S
             switch, to get rid of all index files.

 /R          Rename index file(s). /R and /D options are mutually exclusive.
             When renaming files, all three position sensitive parameters:
             path (. for current dir), filename (the old one - must be entered
             even if it's INDEX.TXT!), and the new one must be specified.

 /A          Also include in documentation:
             H Hidden files
             S System files
             By default, only normal files are included in the list.
             You may also combine H and S to include all files.

 /O          Sort order: (+ normal, - reverse)
             N by file name
             S by file size
             D by file date (default - latest first)
             The sort order will not change the data field order in the
             index file: date is always on the left, followed by size
             and filename.

 Path        Starting directory (Default: Current). The last two parame-
             ters are position sensitive: use a dot (.) to create an
             index file with the name other than default in the current
             directory.  
               
 FileName    Index File Name    (Default: INDEX.TXT)

 NewFileName Used only if /R (rename) switch is specified

   Use MKINDEX /? or /H to get some help.

   MKINDEX will return the following exit codes:

   0 ... Everything was OK
   1 ... Command line parse error (help is displayed) 
   2 ... Fatal error - operation not completed (invalid directory etc..)


3. Problems ?

   This utilily has been tested (rather superficially, I admit) on NT 3.5 Work-
station (build 807) , 3.51 (build 1037), and Win95 (Final Beta), on both FAT and
NTFS filesystems. It won't work under Win 3.1X/Win32s combination. MKINDEX can
handle a maximum of 4096 file entries up to the deepest directory nesting level.
You will have to recompile it for more (or reconsider your filing policy?).
Win95 link (.lnk) files are not included in the index file. 
  

4. File List

   MKINDEX.ZIP should contain the following files:

   MKINDEX.TXT       You're reading it right now
   MKINDEX.EXE       The disk documentation utility
   MKINDEX.CPP       Source code
   MKINDEX.MAK       MS Visual C++ 2.1 make file
   MKINDEX.RC        Resource script (VS_VERSION_INFO only)


-------------------------------------------------------------------------------
IMPORTANT NOTE:

  You may freely use, distribute and enhance the MkIndex's code but please don't
  forget to mention the original author's name. Thanx!


  Please mail your comments, notes, bug reports etc. to:
 
                                             Pekic Zoltan
                                            Rijeka - Croatia
                                         zoltanp@rijeka.riteh.hr 


--------------------------- End of MKINDEX.TXT -------------------------------
