                            User's Manual
                                 for
                            LSD.EXE v2.00
                      Written by Wayne Chestnut
---------------------------------------------------------------------
What does the program do?
LSD is primarily a directory lister with built-in deletion
capabilities for both files and directories. It incorporates a variety
of switch filters and methods of searching that give it enhanced file
finding capabilities. Using the kernel file search engine to find
particular files you may then delete, change the attributes of, change
the date/time stamp of, set to zero length, copy, move, execute user
defined commands upon, dump the results to a text file, or simply view
the results. You may also view information about the physical disk
properties, the hardware, or the raw data on the disks.

Who might find the program useful?
LSD is a high-end technical utility. It is not for someone who prefers
GUI's, doesn't understand disk organization or FATS, or just dislikes
the tedium of commandline-style programs with a lot of commands to
understand and memorize. Persons involved in programming, system
administration, data security, PC repair, or the do-it-yourselfer
would probably find it useful. It may also prove useful for anyone
trying to sort out file system problems as a result of Y2K (Year 2000)
computer hardware/software failures.

What operating system can I run the program on?
LSD was designed to run on all versions of MS-DOS from version 3.XX
and up. It does not support long filenames or the 32-bit FAT, but does
support the 8.3 filename convention in the 16-bit FAT.

What are the terms of usage?
LSD may be used and distributed freely by individuals and businesses
alike without cost. You must use this program and any of it's support
programs at your own risk. I cannot accept responsibility for any
damages incurred as a result of another using this program. I have in
good faith designed this software to function as specified. You may
send a donation to the author if you feel inclined to do so.

Why was the program written?
LSD was written primarily for my personal use. I needed a powerful
DOS-based file manager utility to assist me with PC repair,
troubleshooting, and disk management. It attempts to give me the
tools needed to solve and simplify the types of problems I've
encountered in doing such work. As far as portability was concerned,
it should function at the lowest common denominator:
- Run on all versions of MS-DOS from 3.XX and up.
- Run within the standard 640K of RAM.
- Run on any machine from the 8088/8086 to the 80686, or equivalents.
- Require at a minimum an 80x25 monochrome text monitor.
- Require at a minimum an 84-key keyboard.

Who is the author and how can he be contacted?
Wayne Chestnut
Rt. 2, Box 541-B
Grandview Dr.
Hot Springs, Va. 24445
vwchest@va.tds.net

                           Quick Reference
---------------------------------------------------------------------
Usage of LSD.EXE is:
LSD [[/switch1][/switch2]...] [[[+]filemask1][[+]filemask2]...]
[/excl filemask1 [filemask2]...] [> or >> [drive:][path]filename]

/help - read program help file
/? - quick program help
/s - include subdirectories (also /s[x]+depth)
/n - negate final result
/p - screen page pausing
/g - go to directory
/b - bare listing
/e - in-program commandline editing
/t - selective stepmode
/d - selective deletemode
/ver - display LSD program's version and self-list
/all - search all drives using each filemask on the commandline
/path - search path list using each filemask on the commandline
/home - search resident directory of LSD.EXE using each filemask on
        the commandline
/0../9 - insert macro number into commandline
/q [[+]configfile] - use switch(es) and filemask(s) found in specified
                     configuration file
/sort+(s|a|d|t|n|x)[r] - sort directory
       s - size
       a - attributes
       d - date
       t - time
       n - (whole) filename
       x - extension
       r - sort in reverse order
/list+[drive:][path]filename - use file list for filemask source
/info+driveletter - show system information for specified drive
/read+driveletter - read individual sectors on specified drive
/dpb+driveletter - get drive parameter block information for specified
                   drive
/drives+drivelist - search each drive in the drive list using each
                    filemask on the commandline
/dir+directorymask - list only matches that occur in a directory that
                     fits the specified mask
/find+cm~s"searchtext" - search matching files for "searchtext"
      c - do a case insensitive search
      m - count and display number of matches found
      ~ - negate result
      s - marks the beginning of the searchtext string
/k+(g|l|e)n - set match range for searchtext function
    gmatches - greater than or equal to number
    lmatches - less than or equal to number
    ematches - equal to number
    n - the number of matches (1...2Gb)
/r+(f|x)(g|l|e)mask - set mask ranging
    f - filename portion (8:8.3)
    x - extension portion (3:8.3)
    g - greater than or equal to mask
    l - less than or equal to mask
    e - equal to mask
    mask - a pseudo-filemask
/t+aszkmdu - auto stepmode
   a - change attributes
   s - change file's date/time stamp
   z - set file to zero length
   k - DOS copy file to executing directory
   m - DOS move file to executing directory
   d - DOS delete file
   u - user defined command
/i+dfex~ - directory contents
   d - contains subdirectories
   f - contains files
   e - is empty
   x - exclusive
   ~ - negate result
/x+bln - program exit codes
   b - brief (0...4)
   l - logic (0...1)
   n - none (0)
/j+(a|b|c|d|e)nsubstring - filename substrings
    a - search filename+ext for 'substring' with at least 'n'
        characters matching using first level algorithm.
    b - search filename+ext for 'substring' with at least 'n'
        characters matching using second level algorithm.
    c - search filename+ext for 'substring' with at least 'n'
        characters matching using third level algorithm.
    d - search filename+ext for 'substring' with at least 'n'
        characters matching using fourth level algorithm.
    e - search filename+ext for 'substring' with at least 'n'
        characters matching using fifth level algorithm.
    n - minimum characters matching (1..9, A, B).
/o+fdl - list order
   f - files
   d - directories
   l - labels
/l+dlfxstu~ - list types (inclusive)
   d - directories
   l - (volume) labels
   f - files
   x - executables
   s - operating system files
   t - raw text files
   u - formatted text files
   ~ - negate result
/d+pakdest - deletecodes
   p - delete protected files (hidden, system, read-only attributes)
   a - automatically delete (caution!)
   k - kill files
   d - delete directory names
   e - abort deletion process on error condition
   s - selective delete (prompt on each match)
   t - delete parent directory of tree
/w+cav [[drive:][path]filename] - list view file functions
   c - create/overwrite list view file
   a - create/append to list view file
   v - start list file viewer directly (exclusive)
   [[drive:][path]filename] - load the specified file into the viewer
/c+cxulnv~[s"characterset"] - look for specific filename characters
   c - of the range 000 to 031 ASCII (control characters)
   x - of the range 128 to 255 ASCII (extended characters)
   u - of the range 065 to 090 ASCII (A..Z uppercase)
   l - of the range 097 to 122 ASCII (a..z lowercase)
   n - of the range 048 to 057 ASCII (0..9 numeric)
   v - any invalid character according to DOS filenaming conventions
   ~ - negate result
   s - of the set of characters immediately following (must be the
       last operator if used and set will be case sensitive)
/a+rhsan76x~ - attribute filters (default inclusive)
   r - read-only attribute set
   h - hidden attribute set
   s - system attribute set
   a - archive attribute set
   n - no attributes set
   7 - reserved bit-7 attribute set
   6 - reserved bit-6 attribute set
   x - exclusive operator (must match exactly)
   ~ - negate result
/v+bosadtflk - (video) display modifiers (inclusive)
   b - bare format (exclusive)
   o - show directory name once
   s - show file size in bytes
   a - show file attributes
   d - show file date
   t - show file time
   f - show filename first
   l - split filename to filename ext directory
   k - colorize display
/f+d(g|l|e)CCYYMMDD - set file specs date ranging
   dgCCYYMMDD - greater than or equal to CCYYMMDD
   dlCCYYMMDD - less than or equal to CCYYMMDD
   deCCYYMMDD - equal to CCYYMMDD
/f+t(g|l|e)HHMMSS - set file specs time ranging (24 hour format only)
   tgHHMMSS - greater than or equal to HHMMSS
   tlHHMMSS - less than or equal to HHMMSS
   teHHMMSS - equal to HHMMSS
/f+s(g|l|e)bytes - set file specs size ranging (bytes from 0 to 2Gb)
   sgbytes - greater than or equal to "bytes"
   slbytes - less than or equal to "bytes"
   sebytes - equal to "bytes"
/wd+(g|l|e)weekday - set file date day of week ranging
   gweekday - greater than or equal to "weekday"
   lweekday - less than or equal to "weekday"
   eweekday - equal to "weekday"
   weekday - number representing day of week
/z+snzyxde - summary modifiers
   s - display only the summary information at the end of the search
   n - display only the file information and not the summary
   z - display a separate summary for each filemask on the commandline
   y - show all candidates in summary information
   x - show masked candidates in summary information
   d - show summary of file, subdirectory, and byte counts after each
       directory name
   e - show summary of file, subdirectory, and byte counts after each
       directory name recursing through all subdirectories beneath it
/y+bcsl - calculate and display file checksums and CRC's
   b - 16-bit CRC of the DOS FCB
   c - checksums
   s - 16-bit CRC's
   l - 32-bit CRC's
/h+c~s"searchtext" - search display lines for text
   c - do a case insensitive search
   ~ - negate result
   s - marks the beginning of the searchtext string
/u+(b|m)n - limit search by total bytes/matches
    b - bytes
    m - matches
    n - limit number from 1..2Gb
/m+puagtqlejwxfnrdyzbo - miscellaneous modifiers
   p - allow match(s) only if directory is part of the DOS path
   u - calculate and display bytes used by files/directories as a
       function of cluster usage
   a - display hex rendering of ASCII values in each filename
   g - do not display the program's greeting message
   t - use the alternate tree style (search subdirectories last)
   q - use case sensitive filemasks
   l - display line numbers
   e - echo or display the commandline before listing
   j - echo or display date/time log at program start and end
   w - sound an alert when a match is found
   v - display file dates in Japanese format (CCYY-MM-DD)
   x - display file dates in European format (DD-MM-CCYY)
   f - filemask grouping (in set)
   n - filemask grouping (not in set)
   r - force directory and label size to report as zero bytes
   d - display hex rendering of DOS FCB for each entry
   y - display matches with invalid date stamp
   z - display matches with invalid time stamp
   b - disable internal filemask editing
   o - show day of week in file date display

filemask_ - any valid DOS filemask plus enhancements (multiple
            filemasks accepted)
            + - include subdirectories for that filemask.

/excl filemask1 [filemask2] - exclude the listed filemasks as matches

> or >> [[drive:][path]]filename - dump program output to the filename
                                   at specified location


                          Detailed Reference
---------------------------------------------------------------------
Usage of LSD.EXE is:
LSD [[/switch1][/switch2]...] [[[+]filemask1][[+]filemask2]...]
[/excl filemask1 [filemask2]...] [> or >> [drive:][path]filename]

,,,,,,,,,,,,,,,,,,,,
:    EXECUTABLE    :
''''''''''''''''''''
The executable, LSD.EXE:
- To execute LSD you must be in the directory it resides in or it's
  resident directory must lie in the DOS path.
- If you type LSD at the prompt then it assumes a filemask of *.* for
  the current drive and directory.
- Switches and filemasks are optional.

,,,,,,,,,,,,,,,,,,,,
:     SWITCHES     :
''''''''''''''''''''
The switches, [[/switch1][/switch2]...]:
- Switches are of two physical types; stand-alone and
  identifier+operator(s).
- Switches can be primary or auxilliary in function. Primary switches
  are concerned with the kernel file search engine and it's display of
  results. Auxilliary switches are concerned with specific separate
  functions, e.g. reading disk sectors, showing disk information, etc.
- Switches can be filtering or passive. Filtering switches include or
  exclude a directory entry as a match. Passive switches add
  additional information to or format the display of a directory entry
  that has passed as a match after filtering.
- Any switch or combination of switches are global in their effect,
  i.e. they apply to each filemask and cannot be selectively applied
  to a filemask(s) on the same commandline.
- Some switches take precedence over other switches and will cancel
  the effect of their subordinants if mixed on the command line.
- Some switches are incompatible with other switches and will cause
  the program to abort if mixed on the commandline.
- Most operators are predefined; however some operators require a user
  input string or character after it, e.g. search text string.

- THE STAND-ALONE SWITCHES ARE:
  /help - load this help file, LSDHELP.TXT, into the text viewer. The
          help file must be in the same directory that LSD.EXE is in.
  /? - display to screen a simple program usage statement.
  /s - include subdirectories of the parent directory for each of
       the filemasks encountered in the search (recursing). There are
       two variants available using this switch of the
       identifier+operator class. The syntax is: /s[x]+depth; the 'x'
       operator is optional and means to exclusively list at defined
       depth (default is to list inclusively up to defined depth).
       The 'depth' is a number describing the maximum subdirectory
       levels you want to recurse into. The depth range is 1..65535,
       a depth of zero nullifies recursing and a depth greater than
       10 is probably not necessary. Using '/s' alone sets an
       unlimited depth.
  /n - negate the FINAL result of all masking and filtering, reverses
       the logic.
  /p - pause for each screen full and wait for user input. User may
       page down, step down one line, cancel, branch to next
       directory, or list without paging. The <Enter> key mimics 'P'
       and the spacebar mimics 'S'.
  /g - immediately go to the directory of the first match and exit the
       program. If it's a file or label then it changes to it's
       resident directory, if it's a directory then it changes to it.
       Will change drives too, if necessary.
  /b - bare listing. This function is shorthand for and equivalent to
       '/v+b', see 'Display Functions' section of manual.

*********************************************************************
               In-program Commandline Editing Function
*********************************************************************
  + This switch MUST be the first switch on the original commandline
    typed at the DOS prompt or within a configuration file (if
    desired). On successive edits of the commandline you should leave
    the '/e' as is. All other switch(es) and filemask(s) should then
    follow.
  + Program aborts, fatal errors, and non-returning functions are
    designed to return to the commandline editor upon completion. With
    the possible exception of using a configuration file, and the
    absolute exception of a successful 'goto' directory call.
  + While in the commandline editor the following is true: the <Esc>
    key cancels edit and exits the program, the <Tab> key reloads the
    most recent commandline, the <Enter> key accepts the new
    commandline and recycles program, commandline input is case
    sensitive.
  + The editor has a crude copy and paste function. When the editor
    first loads, the previous and current lines are the same. To copy
    some portion of the line, start by backspacing through the current
    line (while noting the previous line position) until you arrive at
    where you want to insert something, press CTRL+BACKSPACE to copy,
    type in the insert and then press CTRL+ENTER to paste (appending
    the copy).
  + This function is provided to approximately simulate a DOSKEY type
    program, to save time from having to reload LSD.EXE from disk with
    each execution (particularly from a floppy disk), and to allow
    "testing of"/"saving to file" switch/filemask combinations. The
    ability to dump output to a file is lost after the original
    commandline executes, i.e. DO NOT use the following at the end of
    the commandline in editing: "> or >> [drive:][path]filename".
  + Upon exiting the commandline editor you are given the option of
    saving the commandline to a configuration or macro file. If you
    choose to save the data then you are prompted for a filename, a
    default filename is given of which you may edit, you may CANCEL at
    this point by hitting the <Esc> key. If a file of that filename
    exists then you have the option of overwriting, appending, or
    canceling with the option of re-entering a filename. Any failure
    to open or write to the file will result in an option to re-enter
    a filename. As always, the file can be edited with any plain text
    editor at any time.
  /e - in-program commandline editing.

  /t - selective stepmode. See 'Stepmode' section of manual.

  /d - selective deletemode. This function is shorthand for and
       equivalent to '/d+s', see 'Delete Functions' section of manual.

  /ver - display LSD program's version and self-list. This function
         is obligatory and thus should be used alone. It will display
         the program's version number (found in the program greeting
         message), list the LSD.EXE program itself as a match thus
         showing you it's size, attributes, date, time, and resident
         directory, and calculate and display the full set of
         checksums/CRC's.

*********************************************************************
                      Search All Drives Function
*********************************************************************
  /all - Search all drives using each filemask on the commandline. Do
         not include a drive designation on the filemask(s). If you
         include a directory prefix on a filemask then ommit the
         leading backslash. This function performs as the
         '/drives+drivelist' function, it auto-detects which drives
         have a disk and are readable. This function honors wildcards,
         the '+' operator for selective subdirectory inclusions, and
         all other switch filtering.

*********************************************************************
                      Search Path List Function
*********************************************************************
   /path - search path list using each filemask on the commandline. Do
           not include a drive and/or directory designation on the
           filemask(s). This function is closely related in principle
           to the '/all' (search all drives) and '/m+f' (filemask
           grouping) functions. Each directory listed in the DOS
           environment variable PATH is searched one at a time for a
           match from one of the filemask(s). This function differs
           from the '/m+p' (allow match(s) only if directory is part
           of DOS path). Typing "LSD /path" and "LSD c:\ /s /m+p"
           would yield the same results (providing the path didn't
           include directory(s) in drive D,E, etc.), but using '/path'
           would be much quicker as it would search only the path and
           not the entire drive with path filtering.

*********************************************************************
                    Search Home Directory Function
*********************************************************************
  /home - search resident directory of LSD.EXE using each filemask on
          the commandline. Do not include a drive and/or directory
          designation on the filemask(s). This function is closely
          related in principle to the '/all' (search all drives) and
          '/m+f' (filemask grouping) functions. The search is limited
          to one directory however. This function is intended to be
          used primarily for the maintenance of configuration and
          macro files, consequently you may also want to include the
          '/t' SELECTIVE STEPMODE switch to edit these files using the
          text editor subfunction. An example would be:
          "LSD /home macro? /t".

*********************************************************************
                     Commandline Macros Function
*********************************************************************
  + This function is gives you the ability to insert predefined macros
    into the commandline. The insertion of the macro into the
    commandline is position sensitive. Macros may call other macros,
    however if a macro in the chain attempts to call again a macro
    from a previous call this will result in a program abort.
  + A macro may contain any valid switch and filemask combination that
    you would normally enter manually.
  + This function differs from using a configuration file in that you
    may enter additional switches and/or filemasks on the commandline.
    A configuration file determines the entire commandline but a macro
    determines a portion of the commandline. A configuration file may
    call a macro and conversely a macro may call a configuration.
  + There are a possible 20 macro definitions available. However only
    10 definitions are available at program execution. This is
    achieved by allowing an environment variable or else the macro
    file to define it. If the environment variable for a macro is
    defined then it takes precedence over the macro file definition,
    i.e. the program looks for the environment variable first.
  + The length of the commandline after inserting all of the macro(s)
    cannot exceed 127 characters. The program will abort in this
    instance.
  + Environment variables (if used) must be set either at the DOS
    prompt or in a batch file BEFORE executing LSD.
  + The macro file(s) must exist in the same directory that LSD.EXE
    resides in. Macro file(s) must use the required naming convention
    (see table). The first line of text in the file will be the actual
    macro inserted; that line should not exceed 127 characters (extra
    ignored), additional lines of text may be added as comments if
    desired. Any plain text editor may be used to create/edit a macro
    file (also see '/home' SEARCH HOME DIRECTORY FUNCTION).
  + The table below describes the naming conventions. The directory,
    C:\DOS, is shown as an example only, the actual directory name
    that you will use will depend on where LSD.EXE resides on your
    disk drive.

     MACRO | ENVIRONMENT VARIABLE | MACRO FILE
    -------+----------------------+---------------
        /0 | SET MACRO0=          | C:\DOS\MACRO0
        /1 | SET MACRO1=          | C:\DOS\MACRO1
        /2 | SET MACRO2=          | C:\DOS\MACRO2
        /3 | SET MACRO3=          | C:\DOS\MACRO3
        /4 | SET MACRO4=          | C:\DOS\MACRO4
        /5 | SET MACRO5=          | C:\DOS\MACRO5
        /6 | SET MACRO6=          | C:\DOS\MACRO6
        /7 | SET MACRO7=          | C:\DOS\MACRO7
        /8 | SET MACRO8=          | C:\DOS\MACRO8
        /9 | SET MACRO9=          | C:\DOS\MACRO9

  + An example of usage would be:
    - SET MACRO0=/m+g /f+denow /l+f /d+a; meaning do not display
      program greeting message, file dates equal to today, files only,
      and delete automatically
    - LSD /0 *.tmp - execute using macro0 on mask of '*.tmp'
    - LSD /0 c:\cache c:\temp c:\wp\junk - execute using macro0 on
      mask of '*.*' in the three stated directories

  /0../9 - insert macro number into commandline

*********************************************************************
                     Configuration File Function
*********************************************************************
  /q [[+]configfile] - use switch(es) and filemask(s) found in
                       specified configuration file.
                     + This switch is obligatory and thus should be
                       used alone.
                     + If the name of the configuration file is
                       ommitted then the filename, LSD.CFG, is assumed
                       and must be in the directory that LSD.EXE
                       resides in.
                     + In the absence of the '+' operator, the
                       specified configuration file may include a
                       drive and/or path in the name.
                     + When using the '+' operator, do NOT include a
                       drive or path in the name. The named file is
                       assumed to be in the directory that LSD.EXE
                       resides in.
                     + You create/edit a configuration file using any
                       plain text editor. The first line of text
                       should contain the switch(es) and filemask(s)
                       that you desire for that particular
                       configuration. That line can contain no more
                       than 127 characters max (extra ignored). Do NOT
                       include the program name at the beginning of
                       the line. You may have additional lines of text
                       as comments if you so desire. Only one
                       configuration per file is recognized.
                     + Suppose you typed "LSD /q +1":
                       - If LSD.EXE was in the directory, C:\DOS, then
                         the file, C:\DOS\1, would be opened.
                       - If the first line in that file reads:
                         "c:\temp c:\netscape\cache /d+a" then the
                         equivalent typed command would be:
                         "LSD c:\temp c:\netscape\cache /d+a".

- THE IDENTIFIER+OPERATOR(S) SWITCHES ARE:
*********************************************************************
                       Sort Directory Function
*********************************************************************
  + This function allows you to sort the directory information prior
    to displaying. The directory search is forced to the alternate
    tree style (see /m+t). Only one operator of the set {s,a,d,t,n,x}
    may be used, e.g. /sort+n, with one exception being combining the
    'd' date and 't' time operators, e.g. /sort+dt[r]. The 'r'
    operator (reverse sort order) may optionally be included in any
    case, e.g. /sort+xr.
  + Sorting is done per directory and not per the global search. This
    pertains not only to individual filemasks but also to the
    inclusion of subdirectories using '/s' or '+filemask'.
  + The program attempts to sort the directory information via a
    memory sort (very fast), but if there is not enough memory then
    the sort is done using a swap file (very slow). Memory sorts are
    limited to less than 700 directory entries typically.
  + You may abort a sort and the program by hitting <Esc> on the
    keyboard. Hitting any other key will abort the sort in the current
    directory being searched and will display the directory
    information unsorted (memory sort) or partially sorted (swap
    file); sorting resumes in the next directory.

  /sort+(s|a|d|t|n|x)[r] - sort directory
         s - size, file size in bytes
         a - attributes
         d - date
         t - time
         n - (whole) filename
         x - extension
         r - sort in reverse order

*********************************************************************
                        Use File List Function
*********************************************************************
  + This function allows you to specify a file from which a list of
    filemasks is to be read. Each line of text within the file
    represents a separate filemask, the commandline switches are then
    applied to each filemask as though you entered them all on the
    commandline.
  + Filemasks within the file list honors all of the formatting rules
    specified elsewhere in this document, e.g.'s drive and directory
    prefixing, the '+' operator, wildcards, and whole filenames. These
    formatting rules vary depending on what switches are used, e.g.'s
    '/m+f or /m+n', /drives+, /all+, etc.
  + Blank lines are ignored in the list file. Comment lines are
    allowed in the list file, start a comment line with a semicolon
    ';', e.g. ";These are the old WP data files". DO NOT exceed 127
    characters max on any line that specifies a filemask.
  + Put one filemask per line in the list file. However if you are
    using filemask grouping related functions, i.e. '/m+f', '/m+n',
    /path, or /home, you may enter multiple filemasks separated by
    spaces on the same line.

  /list+[drive:][path]filename - use file list for filemask source

*********************************************************************
                     System Information Function
*********************************************************************
  /info+driveletter - Show system information for the specified drive.
                      The drive letter would be A, B, C, etc. This
                      switch is obligatory and thus should be used
                      alone. System information includes:
                      - volume serial number
                      - volume label
                      - calculated 32-bit CRC of boot routine
                      - the maximum number of entries allowed in the
                        root directory and the number of entries
                      - total, used, available clusters
                      - sectors/cluster, bytes/sector, bytes/cluster
                      - total, used, free bytes on disk
                      - current system date and time
                      - operating system version number
                      - equipment installed
                      - keyboard scancode testing in 8-bit mode (XT)
                        and 16-bit mode (AT)

*********************************************************************
                      Read Disk Sectors Function
*********************************************************************
  + NOTE: This function performs ONLY absolute sector READS and at NO
    time will it perform absolute sector WRITES. Rest easy.
  + This function allows you to view the individual sectors on the
    specified drive. The drive letter would be A, B, C, etc. This
    switch is obligatory and thus should be used alone. A sector is
    considered to be 512 bytes in length and the disk is divided into
    however many sectors it takes to cover the entire media. This
    function may not work on CD-ROM drives, networked drives, or other
    special storage devices even though they may be assigned a drive
    letter.
  + The sector data is viewed in an 80 column by 20 row window. There
    is an 80 column ruler along the top to help with identifying
    positions. The 23rd row contains the command prompt on the left
    and a digital gauge on the right. The gauge has a ten digit number
    that shows what sector number is on the first line and a three
    digit number that shows what character position is at the first
    column. The digital gauge is preceeded by a drive letter. The 24th
    and 25th rows are for displaying error messages, progress
    messages, subprompts, and help. The general idea behind the viewer
    is to move the 80x20 window around on a 512x(total sectors) sector
    listing. This viewer does make some use of color in the display.
    Control characters may be displayed in brown and out of bounds or
    unreadable sectors are displayed in red ASCII 179 characters.
  /read+driveletter - read individual sectors on indicated drive. The
                      command prompt choices are as follows:
    "Choices (-,+,U,D,G,>,<,[,],O,K,H,Q,F,A,T,J,R,B,E,Z,C,?): _"
    - - scroll up one line, i.e. go back one sector
    + - scroll down one line, i.e. go forward one sector
    U - scroll up one page (19 lines), i.e. go back 19 sectors
    D - scroll down one page (19 lines), i.e. go forward 19 sectors
    G - go to sector number, whereby you enter a sector number from
        1..9999999999. Pressing the <Esc> key cancels input.
    > - scroll right one character
    < - scroll left one character
    ] - scroll right one page (80 characters)
    [ - scroll left one page (80 characters)
    O - jump to first entry in the root directory table. Here you may
        begin jumps to other directories/files using the 'J'
        subfunction.
    K - put sector character position at column one in the display,
        whereby you enter a character position from 1..512. Pressing
        the <Esc> key cancels input.
    H - Toggle the method of displaying control characters in the
        display. Control characters have ASCII values of 000..031.
        They may be hidden (displayed as spaces) or they may be
        displayed as their ASCII value plus '@' and in brown color.
        e.g. 000+'@'='@', 001+'@'='A', 002+'@'='B', etc. Default is
        ASCII+'@', a toggle indicator is found just before the digital
        gauge.
    Q - Toggle case sensitivity for search subfunctions. Default is
        case sensitive, a toggle indicator is found just before the
        digital gauge.
    F - Find a text string within a sector. Text string can be 30
        characters max. Search begins at current sector and position.
        If control characters are displayed as ASCII+'@' then you may
        search for their pattern. Extended characters can be entered
        in the text string by using the ALT+ASCII method with the
        numeric keypad, e.g. to enter ASCII 247 you press and hold the
        ALT key then hit 2 4 7 on the keypad and then release the ALT
        key. If a match is found then the first line of the display
        will be at the sector and position of it. Pressing the <Esc>
        key cancels input. Pressing the <Esc> key will also CANCEL an
        ongoing search.
    A - Find again the last entered text string. Search resumes at the
        current sector and position showing on the first display line.
    T - Translate the first 32 positions showing on the first display
        line into a directory entry. You are shown the filename.ext,
        size in bytes, attributes, date last modified, time last
        modified, the starting cluster in raw hex, and the calculated
        starting SECTOR in decimal.
    J - This subfunction will display the same information provided in
        the 'T' subfunction and will in addition 'jump' to the
        calculated starting SECTOR.
    R - Recover the file pointed to by the first 32 positions showing
        on the first display line. First you are shown a directory
        entry translation as in the 'T' subfunction. Files are
        recovered by attempting to track the pointers in the cluster
        chain found in the FAT. A pretest is performed to check the
        chain's validity, if the pretest passes then you are prompted
        for a filename to save the data to. Recovery acts as an
        undelete function when the directory entry indicates a deleted
        entry (first character of filename is ASCII 229). Successful
        undeletes are only possible when the clusters have not been
        reused since the file was deleted. WARNING: Save files to a
        different drive if at all possible, to avoid potential
        overwriting of clusters. You may CANCEL at the filename prompt
        or during testing by hitting <Esc> on the keyboard. NOTE: This
        subfunction requires the separate program entitled RS.EXE in
        order to use it.
    B - Boot sector translation. The first line must be at the first
        sector and first position. Information provided from the boot
        sector includes:
        - the 3 commands of the jump to boot routine
        - the manufacturer's name and version number (operating
          system)
        - bytes per sector
        - sectors per cluster
        - number of reserved sectors
        - number of FAT's
        - the maximum number of entries allowed in the root directory
        - number of sectors in volume
        - the media descriptor
        - number of sectors per FAT
        - number of sectors per track
        - number of read/write heads
        - number of hidden sectors
        - location of boot routine
    E - Export the data in the current 20 sectors in the view window
        to a file. The block written to the file will be 20x512 bytes
        and a complete binary equivalent to what is actually contained
        within those sectors. You may append data to an existing file.
    Z - Change to a different drive. Whereby you enter a new drive
        letter (in the range of A..Z) at the subprompt. You may cancel
        by hitting <Esc>. Be sure there is a diskette in the drive if
        applicable.
    C - Cancel viewing and exit the program.
    ? - Get help for command choices. You are presented with a
        subprompt where you enter the choice character you are
        interested in.

*********************************************************************
                    Drive Parameter Block Function
*********************************************************************
/dpb+driveletter - get drive parameter block information for specified
                   drive. The DPB is a structure that DOS creates for
                   each disk drive and is stored at a particular
                   segment and offset in RAM. The following
                   information is provided:
                   - RAM address of current DPB
                   - drive number
                   - sub-unit of device driver for drive
                   - bytes per sector
                   - interleave factor
                   - sectors per cluster
                   - reserved sectors (for boot sector)
                   - number of FAT's
                   - max number of entries in root directory
                   - first occupied sector
                   - last occupied cluster
                   - sectors per FAT
                   - first data sector
                   - RAM address of corresponding device driver
                   - media descriptor
                   - used flag
                   - pointer to next DPB

*********************************************************************
                      Search Drive List Function
*********************************************************************
  /drives+drivelist - Search each drive in the drive list using each
                      filemask on the commandline. Do not include a
                      drive designation on the filemask(s). If you
                      include a directory prefix on a filemask then
                      ommit the leading backslash. The drive list may
                      be up to 26 letters from the set A..Z. Listing
                      the same drive more than once is redundant. In
                      the example "LSD /drives+abc command.com"; the
                      effect is to have typed "LSD a:\command.com
                      b:\command.com c:\command.com". This function
                      honors wildcards, the '+' operator for
                      selective subdirectory inclusions, and all other
                      switch filtering.

*********************************************************************
                       Directory Mask Function
*********************************************************************
  + This function is useful for searching directories that have the
    same name and presumably the same purpose. You might use this
    function to clear all CACHE directories with "LSD c:\ /s
    /dir+cache /d+a" or to clear all temporary files from TEMP
    directories with "LSD /drives+cd *.tmp /s /dir+temp /d+a".
  + Note that the above examples do not use wildcards in the directory
    mask. Wildcards are accepted, it is up to the user to be aware
    of the possible outcome of the search, especially if deleting
    files. The directory mask and any filemask(s) are independent of
    one another.
  + The specified directory mask must be valid, i.e using the 8.3
    DOS filename convention. Do NOT include the drive or any of the
    path in the name. The directory mask is converted to all uppercase
    thus disregarding case.
  /dir+directorymask - list only matches that occur in a directory
                       that fits the specified mask.

*********************************************************************
                         Find Text Functions
*********************************************************************
  + The file text search function will only search within files that
    have met all other criteria. If the text is not found then that
    file will not pass as a match unless the negate option is in
    effect. The process opens and searches all files in binary mode.
  + You may specify DOS reserved, control or extended characters in
    the search text using this format, %nnn, where 'nnn' is a three
    digit ASCII number (000...255). An exception is using %999, this
    code represents one of a group of characters of this set:
    []{}()"';:.,-!? , a space, a newline character, and a tab
    character. This has the effect of looking for a whole word that
    is bound by/ended with enclosures, white space, punctuation,
    quotes, hyphens, or a newline. A general example would be:
    "LSD *.txt /find+sWayne%032Chestnut", where %032 represents the
    space character ' '.
  + The text search will exit any file on the first match encountered
    unless the 'm' operator is used and a total match count is
    desired. The idea being to reduce search time for a simple search.
  + It is possible to search for binary virus signatures within
    executables; if you know what the signature is and it will fit on
    the commandline using the required notation. Example being:
    "LSD c:\ /s /l+x /find+svirussignature".
  /find+cm~s"searchtext" - search matching files for "searchtext"
        c - do a case insensitive search. The default is to do a case
            sensitive search.
        m - count and display number of matches found. The matches
            found for an individual file is displayed within { and };
            e.g. {    7}. The total matches found are displayed in the
            summary information; e.g.
     "          7 search text match(es) +++++++++++++++++++++++++++++"
        ~ - negate result. This will pass as a match any file that
            DOES NOT contain the search text.
        s - marks the beginning of the searchtext string. DO NOT
            enclose the search text in parentheses, they are shown for
            clarity only. This must be the last operator used in this
            switch.

  + The match range switch is to be used with '/find+m...' (count all
    matches). Here you may specify how many times the search text must
    occur within a file before it will pass as a match.
  + The following ranges are allowed:
    - min...g------>max : gvalue <= n <= max
    - min<------l...max : min <= n <= lvalue
    - min..g<--->l..max : gvalue <= n <= lvalue
    - min<--l...g-->max : min <= n <= lvalue OR
                          gvalue <= n <= max
    - min.....e.....max : evalue == n
    - minimum: 1
    - maximum: 21474836647

  /k+(g|l|e)n - set match range for searchtext function
      gmatches - greater than or equal to number
      lmatches - less than or equal to number
      ematches - equal to number. The 'e' operator should be used
                 alone.
      n - number of matches (1...2Gb)

*********************************************************************
                         Mask Range Function
*********************************************************************
  + The mask range function provides a means of filtering the
    filenames and/or extensions of files/directories/labels based on
    whether or not they fall between two range markers. The filtering
    is done only on the matches that have passed the standard original
    masking and is subject to all of the other types of filters.
  + If a range is ommitted as a switch then it is not considered, thus
    giving the flexibility to isolate only the filename or only the
    extension. Of course you may specify both ranges if desired.
  + All mask alphabetic characters are case sensitive. This function
    does not support control or DOS reserved characters in the mask.
  + The 'e' (equal to) operator should be used alone. A match would
    have to start with whatever character(s) were specified. Suppose
    the switch was set to /r+xeEX*; this would actually be a range of
    EX(0x01) through EX(0xff); 0x01 is low value, 0xff is high value.
  + Some examples being:
    - "LSD c:\dos\*.exe /r+fgA* /r+flD*"; here you are listing the
       files in the C:\DOS directory using the '*.exe' filemask but
       restricting those matches to the ones that start with 'A'
       through those that start with 'D' (A* <= 8:8.3 <= D*).
    - "LSD c:\dir1\19990101.* /r+xlRP*"; here you are listing the
      files in the C:\DIR1 directory using the '19990101.*' filemask
      but restricting those matches to the ones that have an extension
      that starts with 'RP' or less (3:8.3 <= RP*).
  + The following ranges are allowed:
    - min...g------>max : gvalue <= portion <= max
    - min<------l...max : min <= portion <= lvalue
    - min..g<--->l..max : gvalue <= portion <= lvalue
    - min<--l...g-->max : min <= portion <= lvalue OR
                          gvalue <= portion <= max
    - variable max = all 0xff characters
    - variable min = all 0x01 characters
    - variable portion = either 8:8.3 (filename) or 3:8.3 (extension)

  /r+(f|x)(g|l|e)mask - set mask ranging
      f - filename portion (8:8.3)
      x - extension portion (3:8.3)
      g - greater than or equal to mask
      e - equal to mask
      l - less than or equal to mask
      mask - a pseudo-filemask

*********************************************************************
                          Stepmode Functions
*********************************************************************
  + The first part of this section describes the selective stepmode
    functions and usage. The second part of this section describes the
    auto stepmode functions and usage.

  + The following is the selective stepmode:
    /t - selective stepmode. Pause for each match and wait for user
         input. The prompt choices are as follows:
         "Command (T/H/G/A/S/Z/K/M/D/U/R/N/B/P/L/!/C/?): _"
         + Note: The commands, T,H,A,S,Z,K,M,D,U,R,!,?, will remain on
                 the current match after executing. The commands, G,C,
                 will exit the program after executing. The commands,
                 N,B,P,L, will continue the search after executing.
         T - view file using text editor/viewer. The default text
             viewer is "EDIT". A user defined text viewer may be
             substituted by setting the environment variable
             "TEXTVIEWER=" in a batch file or at the DOS prompt before
             executing LSD. Examples would be:
             "SET TEXTVIEWER=SEE /R" or "SET TEXTVIEWER=WP".
         H - view file using hex editor/viewer. The default hex
             viewer is "HXD". A user defined hex viewer may be
             substituted by setting the environment variable
             "HEXVIEWER=" in a batch file or at the DOS prompt before
             executing LSD. Examples would be:
             "SET HEXVIEWER=HD /40" or "SET HEXVIEWER=OD".
         G - immediately go to the directory of this match and exit
             the program. If it's a file or label then it changes to
             it's resident directory, if it's a directory then it
             changes to it. Will change drives too, if necessary.
         A - change the attributes of the current match. LSD cannot
             change the attributes of a directory or volume label and
             will not tamper with the reserved attributes. The
             sublevel prompt choices are as follows:
             "Change attributes (R/H/S/A/N/X/C/?) [----]: _"
             R - toggle READ-ONLY attribute.
             H - toggle HIDDEN attribute.
             S - toggle SYSTEM attribute.
             A - toggle ARCHIVE attribute.
             N - set to NO attributes (clear)
             X - execute. Change file's attributes to the current
                 toggled states (exactly as shown in [----]).
             C - CANCEL attribute changes.
             ? - prompt help.
         S - change the date/time stamp of the current match.
             Directories and volume labels not accepted. The original
             date and time are loaded on entry. If a file cannot be
             opened then an error occurs, e.g. read-only. The date
             format is honored, i.e. MM-DD-CCYY or DD-MM-CCYY or
             CCYY-MM-DD. NOTE: only even-numbered seconds are allowed
             as required by DOS. The sublevel prompt choices are as
             follows:
  "Change date/time (+,-,M,D,Y,H,N,S,X,C,?) +[01-01-1980 00:00:00]: _"
             + - increment values. Indicator to left of stamp.
             - - decrement values. Indicator to left of stamp.
             M - change month.
             D - change day.
             Y - change year.
             H - change hour.
             N - change minutes.
             S - change seconds.
             X - execute. Change file's date/time stamp to the current
                 state (exactly as shown in [01-01-1980 00:00:00]).
             C - CANCEL date/time stamp changes.
             ? - prompt help.
             + There is a crude copy and paste function available.
               After changing all the values but before executing the
               changes, hitting CTRL+BACKSPACE will copy the date and
               time. On the successive matches you may paste that date
               and time by hitting CTRL+ENTER. This is intended to
               save time when you want a range of files to have the
               same date and time.
         Z - truncate current match to zero length. Directory and
             volume labels not accepted. If a file cannot be opened
             then an error occurs, e.g. read-only. The sublevel prompt
             choices are as follows:
             "Set file to zero length (Y/C/?): _"
             Y - Yes, set to zero length.
             C - CANCEL and do nothing.
             ? - prompt help.
         K - perform a DOS copy to directory LSD was executed from.
             Command is "COPY /-Y filename ."; force confirmation
             active. Directories and volume labels not accepted.
         M - perform a DOS move to directory LSD was executed from.
             Command is "MOVE /-Y filename ."; force confirmation
             active. Directories and volume labels not accepted.
         D - perform a DOS delete. Command is "DEL filename /P";
             force confirmation active. Directories and volume labels
             not accepted.
         U - execute a user defined command in DOS. You are presented
             with a sublevel prompt, "Enter command: _", here you
             enter the command (up to 50 characters max). If you want
             the command to include the current match then place a
             comma ',' within the commandline. Hitting <Esc> anytime
             or <Enter> on an empty commandline CANCELS input. Only
             one instance of the comma's usage is recognized, the
             filename will be inserted at the comma closest to the end
             of the commandline. WARNING! You should have some idea of
             the consequences of executing the user defined
             commandline before doing so.
             Some examples are as follows:
             - "move , a:\" is interpreted as "move filename a:\"; the
               match would be moved to the A drive's root directory.
             - "truncate /b /000 ," is interpreted as "truncate /b
               /000 filename"; execute program, truncate, using
               specified switches and filename.
             - ", /f" is interpreted as "filename"; attempt to execute
               filename (and switch(es)) as a stand-alone program.
             - "command.com" is interpreted as "command.com"; execute
               the command interpreter and shell to DOS. Note that
               this example doesn't require the matching filename in
               the command.
         R - redisplay the match's directory information.
         N - skip to the next match.
         B - branch to the next directory skipping all matches in
             between.
         P - cancel step mode and transfer to list mode with screen
             page pausing.
         L - cancel step mode and transfer to list mode.
         ! - allows you to review the filemasks and/or switches as
             they appeared on the commandline.
         C - cancel step mode and abort program.
         ? - prompt help.

  + Environment variables must be set either at the DOS prompt or in a
    batch file BEFORE executing LSD in auto stepmode.
  + Auto stepmode is protected by the emergency brakes feature.
    However because user defined commands are shelling out to the
    operating system and executing external programs there is a good
    chance that the called program may consume the keyboard hits. Keep
    hitting the key until the program aborts or enters selective
    stepmode, it will be a matter of timimg. WARNING! Before setting
    up an automatic stepmode 'script' be certain of the outcome, i.e.
    test it thoroughly.
  + The following is the auto stepmode:
    /t+aszkmdu - auto stepmode.
       a - change the file's attributes. The attributes to change to
           must be specified in the environment variable named
           STPATTR. The format for the variable is "SET STPATTR=xxxx",
           whereby the x's specify which attributes to set; READ-ONLY,
           HIDDEN, SYSTEM, ARCHIVE, or NONE. The variable must always
           be four characters in length, you use operators of the set
           {r,h,s,a,-}. The attributes are changed to exactly what is
           specified. Some examples are as follows:
           SET STPATTR=---- this would clear all attributes.
           SET STPATTR=r--a this would set the READ-ONLY and ARCHIVE
                            attributes.
           SET STPATTR=-h-- this would set the HIDDEN attribute.
       s - change file's date/time stamp. You may specify only the
           date, only the time, or both the date and time. If one is
           ommitted then the file retains it's original. The date to
           change to must be specified in the environment variable
           named STPDATE. The format for the variable is
           "SET STPDATE=CCYYMMDD", whereby you specify the century
           through the day, e.g. SET STPDATE=19990101. The time to
           change to must be specified in the environment variable
           named STPTIME. The format for the variable is
           "SET STPTIME=HHMMSS", whereby you specify the hour through
           the second, e.g. SET STPTIME=120000. File time stamp's
           seconds are in even numbered increments as required by DOS.
       z - set file to zero length. This function will open the file
           and truncate it to a length of zero bytes, i.e. empty the
           contents but not delete the file.
       k - DOS copy file to executing directory. Perform a DOS copy of
           the file to the directory you were in when you first
           executed LSD. The command is "COPY filename .", unlike in
           selective stepmode, confirmation of overwrite is disabled.
       m - DOS move file to executing directory. Perform a DOS move of
           the file to the directory you were in when you first
           executed LSD. The command is "MOVE filename .", unlike in
           selective stepmode, confirmation of overwrite is disabled.
       d - DOS delete file. Perform a DOS delete of the file. The
           command is "DEL filename", unlike in selective stepmode,
           confirmation of delete is disabled.
       u - user defined command. The user command(s) to use must be
           specified in the environment variable(s) USERCOMx. The
           format for the variable(s) follows the same convention
           outlined in the user defined commands of selective stepmode
           (see above). In auto stepmode you are allowed to specify
           up to seven user defined commands, however there are only
           seven operators max allowed, therefore for each built-in
           operator you specify this detracts one from the total user
           defined commands allowed. The 'x' in the variable USERCOMx
           is to be replaced by a sequence number of the range 1...7.
           If you have one user command then set only USERCOM1, if two
           then set USERCOM1 and USERCOM2, etc. You then put the 'u'
           operator(s) within the auto stepmode operators according to
           the chronological order desired. This is the only operator
           of this group that allows distinct multiple usage.
           The following example shows the ground work needed:
           - to prepare "LSD c:\dir1\*.log /t+auzu"
           - set STPATTR=----
           - set USERCOM1=copy , c:\dir2
           - set USERCOM2=rec /date /time ,
           - execute "LSD c:\dir1\*.log /t+auzu". Search for file's
             fitting the mask '*.log' in the directory C:\DIR1. For
             each match do the following:
             - clear the attributes
             - execute USERCOM1, copying file to directory C:\DIR2
             - set file to zero length, i.e. empty contents
             - execute USERCOM2, a fictitious program 'REC' records a
               system date and time to file.
           + NOTE: You should specify programs and/or commands to be
             executed as user defined that are themselves
             self-exiting, i.e. they execute and return to the command
             line. To be truly automatic you may not want called
             programs requesting user input.
           + There are external provisions to abort auto stepmode or
             force auto stepmode to transfer to selective stepmode.
             Auto stepmode will abort if a file named STPHALT.000 is
             created in the root directory of the drive LSD was
             executed from. The contents of the file are irrelevant,
             only that it exists. An external called program or batch
             file can be configured to create this file based on some
             internal logic. Auto stepmode will transfer to selective
             step mode if a file named STPSTEP.000 is created under
             the same rules. These files are deleted by LSD prior to
             beginning the auto sequence.

*********************************************************************
                     Directory Contents Function
*********************************************************************
  + This function scans mask matching directory names to see if they
    contain the type(s) specified in the operator(s). It is intended
    but not required to be used with the '/l+d' switch. This simply
    will inform you as to the presence or absence of files and/or
    subdirectories within the subdirectories of the starting
    directory. Example being: 'LSD c:\ /s /l+d /i+e', this will return
    as matches any of the subdirectories beneath the root directory
    that contain neither files or directories (are empty).
  + The default is to logically 'OR' the operators, meaning the
    directory can contain any of the types specified. Using the 'x'
    operator the directory must contain all of the types exactly as
    specified.
  /i+dfex~ - directory contents
     d - contains subdirectories
     f - contains files
     e - is empty
     x - exclusive, must contain exactly the type(s) specified.
     ~ - negate results, i.e. a not operator that reverses the logic
         for the result of this switch

*********************************************************************
                     Program Exit Codes Function
*********************************************************************
  + Exit codes indicate the terminating status of the program to the
    operating system. They may be of the range 0...255. If you want to
    manipulate the flow of logic in a batch file then you can use
    "IF ERRORLEVEL xxx" statements to do so. Consult a DOS manual for
    a more detailed explanation.
  + A normal exit occurs when the program executes to completion
    without error or interruption. An internal program error occurs
    when an operating system function call fails. An user input error
    occurs when there is invalid, missing, or conflicting switch(es)
    or their operators and/or invalid filemask formatting. A user
    abort occurs when the program is terminated by keyboard input,
    e.g. using the emergency brake features. A debugging exit should
    not occur in public releases of LSD.EXE. The exit code for error
    exits and program aborts are displayed at the end of the
    terminating message; e.g. "USER ABORT - paging screens [253]".
  + When employing this switch you may specify only one operator, i.e.
    /x+b, /x+l, or /x+n.
  + Exit codes are returned based on the following table:

    DEFAULT  BRIEF      LOGIC      NONE       DESCRIPTION
    ==================================================================
    0        0          0          0          normal program exit
    1.....99 1          1          0          internal program error
    100..199 2          1          0          user input error
    200..254 3          1          0          user abort
         255 4          1          0          debugging (N/A)

  /x+bln - program exit codes
     b - brief (0...4).
     l - logic (0..1).
     n - none (0).

*********************************************************************
                     Filename Substring Functions
*********************************************************************
  + These functions provide a tool for that instance where you might
    say "All I remember about that filename was that it had four 'X's
    in it" or "it had JEFF or JAFF or GEFF or something like that in
    it".
  + The filename substring functions allow you to look for the
    substring within the filename and extension combined, i.e. IO.SYS
    becomes IOSYS, DEFRAG.EXE becomes DEFRAGEXE, etc.
  + The first operator specifies what algorithm to use in determining
    matches. You may use only one of the choices in this switch
    position.
  + The second operator, 'n', is the minimum number of characters
    matching that you will accept, the absolute range is 1..11
    (FILENAMEEXT), however 'n' cannot exceed the length of the
    substring. The notation for 'n' is as follows: 1..9, A=10, B=11.
  + The substring is case sensitive, can include extended characters,
    but does not support DOS reserved or control characters. It can be
    from 1..25 characters in length.
  + Matches will preserve the rank of positions within the 'substring'
    whether or not they are consecutive within the 'filename+ext'
    being considered, using one of the first four algorithms.

  /j(a|b|c|d|e)nsubstring - filename substrings
     a - search filename+ext for 'substring' with at least 'n'
         characters matching from start of substring and in
         continuous order. Suppose the switch was set to /ja+3RIGHT,
         a filemask equivalent notation would be *RIG*. NOTE: It would
         have made more sense to have used /j+a3RIG but it was done
         this way for comparison to the other levels. This is the
         first level algorithm.
     b - search filename+ext for 'substring' with at least 'n'
         characters matching from within substring and in continuous
         order. Suppose the switch was set to /j+b3RIGHT, the filemask
         equivalent notations would be *RIG*, *IGH*, and *GHT*. This
         is the second level algorithm.
     c - search filename+ext for 'substring' with at least 'n'
         characters matching from within substring that are in the
         same relative position within the filename+ext. Suppose the
         switch was set to /jc+3RIGHT, the filemask equivalent
         notations would be *??GHT*, *?I?HT*, *?IG?T*, *?IGH?*,
         *R??HT*, *R?G?T*, *R?GH?*, *RI??T*, *RI?H?*, and *RIG??*.
         This is the third level algorithm.
     d - search filename+ext for 'substring' with at least 'n'
         characters matching from within substring while preserving
         ranking. Suppose the switch was set to /j+d3RIGHT, the
         equivalent filemask notations would be *G*H*T*, *I*H*T*,
         *I*G*T*, *I*G*H*, *R*H*T*, *R*G*T*, *R*G*H*, *R*I*T*,
         *R*I*H*, and *R*I*G*. This is the fourth level algorithm.
     e - search filename+ext for 'substring' with at least 'n'
         characters matching from within substring. Suppose the switch
         was set to /j+e3RIGHT, the equivalent filemask notations
         would be *R*, *I*, *G*, *H*, and *T*, three of those five
         filemasks would have to return true to have a match and may
         occur in any order. This is the fifth level algorithm.

*********************************************************************
                         List Order Function
*********************************************************************
  + The default for the program is to list matches in the order they
    occur within the DIR entries. This order is determined at the time
    of file/directory creation, thus entries are intermingled with
    directory, file, and a label name(s).
  + The list order function basically makes three passes through a
    particular directory in hand during a search. Each pass has a
    particular type to look for; file, directory, or label. If the
    type is appropriate for the pass then it goes on to consider the
    masking and filtering for each entry.
  + If you use this switch then you must specify the order for all
    three types, i.e. /o+fdl, /o+ldf, /o+lfd, etc. Use the switch only
    once, the first operator is the first type to list, the second
    operator is the second type to list, and the third operator is the
    third type to list.
  /o+fdl - list order
     f - files (neither directories or labels)
     d - directories
     l - (volume) labels

*********************************************************************
                         List Type Functions
*********************************************************************
  + The list types identifier will pass only matches that are included
    in the specified operator(s).
  + The two text file operators do not guarantee that a match is a
    text file, but it is a very high probability that it is.
  /l+dlfxstu~ - list types
     d - directories (excluding the '.' and '..' designations)
     l - (volume) labels (only one label per drive may exist)
     f - files (not a directory or label)
     x - executables (files that have an extension of BAT|COM|EXE)
     s - operating system files. Those basic files used by DOS of the
         following list:
         IO.SYS       MSDOS.SYS    COMMAND.COM  DRVSPACE.BIN
         IBMBIOS.COM  IBMBIO.COM   IBMIO.SYS    IBMDOS.COM
         CONFIG.SYS   AUTOEXEC.BAT HIMEM.SYS    EMM386.EXE
     t - raw text files. Files which contain any ASCII 032..126
         characters, the CR/LF pair(s) (ASCII 013/010), and allowing
         for the ASCII 026 (CTRL+Z) end-of-file marker.
     u - formatted text files. Files which meet the raw text file
         criteria and may additionally contain the following:
         009 - TAB character
         012 - FORMFEED character
         127 - DELETE character
         128..255 - EXTENDED character set
     ~ - negate results, i.e. a not operator that reverses the logic
         for the result of this switch

*********************************************************************
                           Delete Functions
*********************************************************************
  + The deletecodes identifier will default to selective deletion,
    simple deletion (no kill), and bypassing protected files.
    Protected files are defined as having any/all of the READ-ONLY,
    HIDDEN or SYSTEM attributes set. In the display, successful
    deletes are ended with ...OK, successfull kills are ended with
    ...KILLED, files not deleted because of protected status are ended
    with ...PROTECTED, and files or directories that could not be
    deleted are ended with ...ERROR.
  + Delete mode can act as a DELTREE function when used with '/s'
    (include subdirectories), using a '*.*' filemask, using the
    default tree style and using the following operators: /d+padt.
  + Delete failures can be due to disk/drive failure, file locking, or
    write-protected disk for both files and directories. In addition,
    directory delete failures can occur because the directory is not
    empty or that directory is the current working directory for that
    drive. LSD cannot delete volume labels, therefore labels are
    ignored in delete mode.
  /d+pakdest - deletecodes
     p - include protected files in the deletions.
     a - automatically proceed with the deletions. Use extreme caution
         when employing this operator, you may not be able to recover
         the lost data even with an UNDELETE utility. This mode is
         protected by 'emergency brakes'; if you hit <Esc> then the
         program aborts, if you hit any other key then it reverts to
         selective deletion. Choosing (A)ll during selective deletion
         enters the auto mode.
     k - kill files. The idea behind killing files is to make the data
         purposefully irrecoverable. The file is first rewritten in
         it's entirety with NULL bytes (00 hex) out to it's true size
         in cluster usage, then it is truncated to zero length in the
         DIR entry, it's date is set to 01-01-1980,it's time is set to
         00:00:00, it's attributes are cleared, it is renamed to all
         ASCII 229 (E5) characters, and finally deleted. Killing
         directories is equivalent to simple deletion. If this
         function has successfully completed all of the steps then it
         may only be defeated if a backup had been performed before
         killing the file. There is only one delete call in this
         process, the other steps are performed using file opens,
         rewrites, and closings, therefore an UNDELETE utility should
         not be able to recover any useful data other than a file
         named with all 0xE5's that is stamped 01-01-1980 00:00:00
         with no attributes set and a size of zero bytes, and all of
         the killed files will have these specs.
     d - delete directory names. Directories can only be deleted if
         all of it's files and subdirectories have been deleted first.
     e - abort deletion process on error condition. This simply means
         to terminate the program on the first failure to delete a
         file or directory.
     s - selective delete. Pause for each match and wait for user
         input. User may delete/skip that match, enter auto mode,
         cancel, view the file before acting, branch to next
         subdirectory, stop deletion and enter listing with/without
         page pausing. See 'STEP MODE' (/t[+...]) for detailed
         description of the external viewers.
     t - delete parent directory of tree. This function will attempt
         to delete the parent directory of a particular filemask. If
         you typed "LSD c:\temp\*.* /d+at" then the files fitting the
         '*.*' mask within the directory will be deleted first and
         then the directory itself (c:\temp) will be deleted. The
         above example without the 't' operator would just delete the
         files. In selective delete mode you are presented with a
         prompt "Delete tree parent (Y/N/C)? _"; here you may delete
         the directory, skip it, or cancel and abort the program. This
         function honors the rest of the deletecodes group functions
         as defined.

*********************************************************************
                    Write List View File Functions
*********************************************************************
  + The write list view file identifier will create a file called
    LSD{0}.TMP in the root directory of the current drive. This file
    is made up of a number of 240 byte records that represent each
    match found in the file search. The default is to create/append
    to the list view file.
  /w+cav [[drive:][path]filename] - list view file functions
     c - create or overwrite the list view file
         (lose all previous data)
     a - create or append to the list view file
         (create only if it doesn't exist)
     v - start the listfile viewer directly (ignoring all other
         switches)
     [[drive:][path]filename] - load the specified file into the
                                listfile viewer. To be used only in
                                conjunction with /w+v. If this
                                filename is ommitted then the default,
                                /LSD{0}.TMP is assumed. The file must
                                be an export of some previously
                                created sortfile, i.e. in the 240 byte
                                record format.
  + The list data is viewed in an 80 column by 20 row window. There
    is an 80 column ruler along the top to help with identifying
    positions. The 23rd row contains the command prompt on the left
    and a digital gauge on the right. The gauge has a five digit
    number that shows what record number is on the first line and a
    three digit number that shows what character position is at the
    first column. The 24th and 25th rows are for displaying error
    messages, progress messages, subprompts, and help. The general
    idea behind the viewer is to move the 80x20 window around on a
    240x(total records) record listing.
  + Control characters are converted to spaces before displaying.
    However their existence in the listing is rare.
  + Before executing the listfile viewer you are presented with the
    sortfile name and a prompt. The prompt allows you to view the
    listfile, cancel, or cancel with deletion of the current listfile.
  + The command prompt choices are as follows:
    "Choices (-,+,U,D,G,>,<,[,],K,Q,F,A,E,X,C,?): _"
    - - scroll up one line, i.e. go back one record
    + - scroll down one line, i.e. go forward one record
    U - scroll up one page (19 lines), i.e. go back 19 records
    D - scroll down one page (19 lines), i.e. go forward 19 records
    G - go to record number, whereby you enter a record number from
        1..32767. Pressing the <Esc> key cancels input.
    > - scroll right one character
    < - scroll left one character
    ] - scroll right one page (80 characters)
    [ - scroll left one page (80 characters)
    K - put record character position at column one in the display,
        whereby you enter a character position from 1..240. Pressing
        the <Esc> key cancels input.
    Q - Toggle case sensitivity for search subfunctions. Default is
        case sensitive, a toggle indicator is found just before the
        digital gauge.
    F - Find a text string within a record. Text string can be 30
        characters max. Search begins at first record (reseting).
        Extended characters can be entered in the text string by using
        the ALT+ASCII method with the numeric keypad, e.g. to enter
        ASCII 247 you press and hold the ALT key then hit 2 4 7 on the
        keypad and then release the ALT key. If a match is found then
        the first line of the display will be at the record and
        position of it. Pressing the <Esc> key cancels input.
        Pressing the <Esc> key will also CANCEL an ongoing search.
    A - Find again the last entered text string. Search resumes at the
        current record and position showing on the first display line.
    E - Export the data in the entire listfile to another file, i.e.
        similiar to a 'save as' function. You may append data to an
        existing file. You remain on the original file in the viewer.
    X - Delete the current list view file, cancel viewing, and exit the
        program.
    C - Cancel viewing and exit the program.
    ? - Get help for command choices. You are presented with a
        subprompt where you enter the choice character you are
        interested in.

*********************************************************************
                Specific Filename Characters Functions
*********************************************************************
  + The specific filename characters identifier allows you to look for
    any of the characters in a given set within a filename (excluding
    the directory prefix). This function is included in part because
    on occasion I have found that some programs have written directly
    to the DIR entry, thus circumventing the usual DOS rules for
    naming files or directories.
  /c+cxulnv~s"characterset" - specific filename characters
   c - of the range 000 to 031 ASCII (control characters)
   x - of the range 128 to 255 ASCII (extended characters)
   u - of the range 065 to 090 ASCII (A..Z uppercase)
   l - of the range 097 to 122 ASCII (a..z lowercase)
   n - of the range 048 to 057 ASCII (0..9 numeric)
   v - any invalid character according to DOS filenaming conventions.
       The valid characters for naming files total 181 and are in the
       sets: !#$%&'()-0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYXZ^_`{}~ and
       ASCII 127...ASCII 255. Invalid characters total 75 and are in
       the sets: ASCII 000...ASCII 032 and "*+,./:;<=>?[\]| and
       abcdefghijklmnopqrstuvwxyz. One period '.' is considered valid
       to separate the filename from the extension but more than one
       period is invalid (ignoring the parent directory entry '..'
       however).
   ~ - negate results, i.e. a not operator that reverses the logic
       for the result of this switch
   s"characterset" - of the set of characters immediately following
                     (must be the last operator if used and set will
                     be case sensitive). You may specify DOS reserved,
                     control or extended characters using this format,
                     %nnn, where 'nnn' is a three digit ASCII number
                     (000...255).
                   An example would be: "LSD *.* /c+ls%032%127%255".

*********************************************************************
                      Attribute Filter Functions
*********************************************************************
  + The attribute filters identifier allows you to look for matches
    that have any of the attributes set as specified (inclusive) or
    all of the attributes set exactly as specified (exclusive). The
    third and fourth positions of the attribute display designate a
    directory (--D-----) or a volume label (---V----) and are not
    considered.
  /a+rhsan76x~ - attribute filters
     r - (--..r---) read-only attribute set
     h - (--..-h--) hidden attribute set
     s - (--..--s-) system attribute set
     a - (--..---a) archive attribute set
     n - (--..----) no attributes set
     7 - (x-..----) reserved bit 7 attribute set
     6 - (-x..----) reserved bit 6 attribute set
     x - exclusive operator (must match exactly). If the switch is
         /a+rhsx then the attributes must be only --..--rhs- in the
         display to match exactly.
     ~ - negate results, i.e. a not operator that reverses the logic
         for the result of this switch

*********************************************************************
                          Display Functions
*********************************************************************
  + The (video) display indentifier allows you to select portions of
    the default line display and/or format the filename. The original
    display order is preserved. The file name portion will always
    display. When using any operators of the set (sadt), then only the
    operator(s) stated will display.
    Reference display line:
    Positions ->
.....................................................................
         1         2         3         4         5         6         7
1234567890123456789012345678901234567890123456789012345678901234567890
         7 -------a  12-19-1998  19:09:24   A:\FILE1.TXT
.....................................................................
  /v+bosadtflk - (video) display modifiers
     b - use bare format (exclusive). Shows only the file name
         (position 45...end).
     o - show directory name once. The directory is displayed once
         for any directory having a match(es). Filenames lose the
         directory prefix. Looks best when using the alternate tree
         style "/m+t" (see miscellaneous identifier). Example being:
========================....................=========................
Directory listing of A:\

         7 -------a  12-19-1998  19:09:24   FILE1.TXT
========================....................=========................

     s - show file size in bytes. Include positions 1...10.
     a - show file attributes. Include positions 12...19.
     d - show file date. Include positions 22...31.
     t - show file time. Include positions 34...41.
     f - show filename first. Display the filename first on the
         display line. Looks best when used with the 'o' and 'l'
         operators. The executable and inpath markers ('*') will then
         display after the filename.
     l - split the file name into components. The components being
         filename ext directory. An example would be:
............................................=================........
         7 -------a  12-19-1998  19:09:24   FILE1    TXT  A:\
............................................=================........
     k - colorize display. Colorizing ONLY applies to the line
         displays and not the summary, error messages, etc. Volume
         labels are green, files are cyan (blue), directories are
         yellow, executables are bright white (unless it is also a
         system file), and system files are red. A drawback to using
         colorization is that the ability to dump line display to a
         file (or device) is lost, as display is done directly to the
         video and not the standard output device.

*********************************************************************
                         File Specs Functions
*********************************************************************
  + The file specs identifier allows file date, time, and/or size in
    bytes ranges to be considered. The date format is CCYYMMDD,
    meaning 19981219 for example. The dates must fall between 19800101
    and 20991231. The time format is HHMMSS, meaning 103000 or 223000.
    The times are in 24 hour format 000000...115959 (AM) and
    120000...235959 (PM). The byte size format is variable length but
    must fall between 0 and 2Gbytes (2147483647). The equals (e)
    operator should be used alone. The following ranges are allowed:
    - min...g------>max : gvalue <= spec <= max
    - min<------l...max : min <= spec <= lvalue
    - min..g<--->l..max : gvalue <= spec <= lvalue
    - min<--l...g-->max : min <= spec <= lvalue OR
                          gvalue <= spec <= max
    - min.....e.....max : evalue == spec
    - minimums: 19800101; 000000; 0
    - maximums: 20991231; 235959; 21474836647
  + NOTE: You may use 'now' instead of CCYYMMDD or HHMMSS in the date
    or time respectively to substitute the system clock value. Example
    being; 'LSD /f+denow', if today is 02-15-1999 then the equivalent
    command would be 'LSD /f+de19990215'.
  /f+d(g|l|e)CCYYMMDD - set file specs date ranging
     dgCCYYMMDD - greater than or equal to CCYYMMDD
     dlCCYYMMDD - less than or equal to CCYYMMDD
     deCCYYMMDD - equal to CCYYMMDD
  /f+t(g|l|e)HHMMSS - set file specs time ranging (24 hour format only)
     tgHHMMSS - greater than or equal to HHMMSS
     tlHHMMSS - less than or equal to HHMMSS
     teHHMMSS - equal to HHMMSS
  /f+s(g|l|e)bytes - set file specs size ranging (bytes from 0 to 2Gb)
     sgbytes - greater than or equal to "bytes"
     slbytes - less than or equal to "bytes"
     sebytes - equal to "bytes"

*********************************************************************
                File Date Day of Week Ranging Function
*********************************************************************
  + This function is provided to allow the user to filter matches
    based on what day of the week the date stamp indicates.
  + The following list describes the notation for the day of the week:
    0 - Unknown or Incalculable
    1 - Monday
    2 - Tuesday
    3 - Wednesday
    4 - Thursday
    5 - Friday
    6 - Saturday
    7 - Sunday

  + The following ranges are allowed:
    - min...g------>max : gvalue <= weekday <= max
    - min<------l...max : min <= weekday <= lvalue
    - min..g<--->l..max : gvalue <= weekday <= lvalue
    - min<--l...g-->max : min <= weekday <= lvalue OR
                          gvalue <= weekday <= max
    - min.....e.....max : evalue == weekday
    - minimum: 0
    - maximum: 7

  /wd+(g|l|e)weekday - set file date day of week ranging
     gweekday - greater than or equal to "weekday"
     lweekday - less than or equal to "weekday"
     eweekday - equal to "weekday"
     weekday - number representing day of week

*********************************************************************
                      Summary Modifier Functions
*********************************************************************
  /z+snzyxe - summary modifiers
     s - display only the summary information at the end of the
         search (exclude all individual file information).
     n - display only the individual file information and not the
         summary information.
     z - display a separate summary for each filemask on the
         commandline (the global summary is not calculated/displayed).
     y - show all candidates in summary information. This function
         adds a total count of the files, directories, labels,
         entries, and bytes that were encountered in the search before
         being masked or filtered by switches.
         Example being (lsd a:\*.txt /m+y):
.....................................................................
         7 -------a  12-19-1998  19:09:24   A:\FILE1.TXT
         7 -------a  12-19-1998  19:09:28   A:\FILE2.TXT
         7 -------a  12-19-1998  19:09:30   A:\FILE3.TXT
         3 file(s)             0 dir(s)             0 label(s)
         8 FILE(S)             2 DIR(S)             1 LABEL(S)
         0 exec(s)             0 inPath             3 nonexec(s)
         3 total              21 bytes
        11 TOTAL              56 BYTES
                        28393472 bytes left on drive C
.....................................................................
     x - show masked candidates in summary information. This function
         adds a total count of the files, directories, labels,
         entries, and bytes that were encountered in the search after
         being masked but before being filtered by switches.
     d - show summary of file, subdirectory, and byte counts after each
         directory name. The counts are taken from the first level of
         the directory in hand, i.e. no recursing into subdirectories.
         Bytes sizes of directory entries can be forced to zero using
         the '/m+r' switch. This function is independent of the other
         operators in this switch but is a summary none-the-less. An
         example being "LSD a:\ /l+d /z+d":
................====================================.................
         0 --D-----  12-19-1998  19:09:16   A:\DIR1
                3 file(s)       2 dir(s)          21 byte(s)
         0 --D-----  12-19-1998  19:09:18   A:\DIR2
                0 file(s)       0 dir(s)           0 byte(s)
         0 file(s)             2 dir(s)             0 label(s)
         0 exec(s)             0 inPath             0 nonexec(s)
         2 total               0 bytes
                        28401664 bytes left on drive C
................====================================.................

     e - show summary of file, subdirectory, and byte counts after each
         directory name recursing through all subdirectories beneath
         it. This operator extends the summation of the 'd' operator
         to include full recursion into subdirectories of the
         directory in hand. This allows you to see what directory
         trees are using the most disk space at a glance.

*********************************************************************
                   File Checksums and CRC Functions
*********************************************************************
  + Checksums and CRC's are a means of expressing the contents of a
    file as a hexadecimal number. They are calculated by reading each
    individual character in a file into a specific formula for a
    particular method. They can be used to compare files of the same
    name or test to see if a file has been modified. Files of
    different sizes and/or date/time stamps would be obviously
    different. One use of interest would be to record the CRC's of EXE
    and COM executables when installed, then if a virus problem occurs
    at some point and that virus has altered an EXE/COM file, a
    recalculation of those CRC's may help to pinpoint the corrupted
    file(s).
  + When calculating the checksum/CRC of a file's contents, a value of
    zero (0000 or 00000000) will always be returned on directories,
    labels, files that could not be opened, and zero-length files.
  + There are four calculation methods available. You may choose any
    combination that you desire. Only the method(s) chosen will be
    displayed and always follow this order; 16-bit CRC of DOS FCB -
    (simple) checksum - 16-bit CRC - 32-bit CRC; when a method is
    ommitted then the gap is closed in the display order.
  + Global checksums and CRC's are calculated and displayed in the
    summary information. The input for the individual files is each
    character read from the file and the input for the global is the
    checksum/CRC of each file.
  /y+bcsl - calculate and display file checksums and CRC's
     b - 16-bit CRC of the DOS FCB. This function calculates a 16-bit
         CRC (using method described below) for the following bytes in
         the DOS File Control Block found in the DIR entry:
         - drive number
         - directory number
         - entry number
         - attributes
         - time stamp
         - date stamp
         - file size
         It does not open the file. It is displayed as a 4 digit upper
         cased hexadecimal number enclosed in parentheses,
         e.g. (C0DB).
     c - checksums. This is the 'simple' checksum method. It is
         calculated by adding the byte read's value to the total then
         adding the remainder of the total divided by the byte read's
         value to the total. It is displayed as a 4 digit upper cased
         hexadecimal number.
     s - 16-bit CRC's. This method uses a formula that exclusively
         OR's values based on a built-in fixed 256 member integer
         array and the byte read's value. It is displayed as a 4 digit
         lower cased hexadecimal number.
     l - 32-bit CRC's. This method uses a formula that exclusively
         OR's values based on a built-in fixed 256 member long integer
         array and the byte read's value. It is displayed as a 8 digit
         lower cased hexadecimal number.
   + An example being "LSD /y+csl a:\file?.txt":
.....................................====.====.========...............
    7 -------a  12-19-1998  15:05:54 02BC ef5b 7fa0ce61   A:\FILE1.TXT
    7 -------a  12-19-1998  19:09:28 02B8 df38 7de67038   A:\FILE2.TXT
    7 -------a  12-19-1998  19:09:30 02A4 cf19 7c241a0f   A:\FILE3.TXT
    3 file(s)             0 dir(s)             0 label(s)
    0 exec(s)             0 inPath             3 nonexec(s)
    3 total              21 bytes    084C 2699 ce8b2690
                   27578368 bytes left on drive C
.....................................====.====.========...............

*********************************************************************
                    Search Display Lines Function
*********************************************************************
  + This function is provided to approximately simulate piping the
    display through the DOS program FIND.EXE. However the search is
    limited to the individual lines of directory entry display and
    ignores the greeting, summary, error messages, etc. The summary
    reflects the actual number of entries that passed all of the
    other filters and masking first, but ultimately this switch
    filter.
  + All of the display line is subject to the string search. This
    includes not only the default information but any additional
    information added by passive switches, i.e. cluster usage, CRC's,
    FCB's, filename ASCII, etc. If you've ever scanned through a long
    directory list 'by hand' looking for a particular string somewhere
    in the lines then this function fits the bill.
  + The '/n', negate final result, switch applies to every other
    switch filter and masking, but has no control over this switch.
  /h+c~s"searchtext" - search displays line for text
     c - do a case insensitive search. The default is to do a case
         sensitive search.
     ~ - negate result. Pass as a match any display line that DOES NOT
         contain the searchtext.
     s - marks the beginning of the searchtext string. The string does
         not support DOS reserved or control characters in it. DO NOT
         include the quotes, they are for clarity only.

*********************************************************************
            Limit Search by Total Bytes/Matches Functions
*********************************************************************
  + This function will allow you to end a search when the total number
    of matches or the total bytes used by the matches is equal to or
    exceeds the specified number. This filter is global in nature,
    however if used with the '/z+z', separate filemask summaries, it
    will apply to each filemask separately as well. It may prove
    useful when combined with a delete function to set a limit on the
    number of matches or bytes used by matches to delete.
  + You may specify both limitations, simply use the switch twice on
    the commandline, e.g. LSD /u+m100 /u+b100000. This would list the
    first 100 matches or the first 100000 bytes used, whichever comes
    first.
  + Determination of what passes as a match is subject to the other
    switch filter(s) and filemask(s) first, but ultimately to these
    switch filters.

  /u+(b|m)n - limit search by total bytes/matches
      b - bytes
      m - matches
      n - limit number from 1..2Gb (1..21474836647)

*********************************************************************
                       Miscellaneous Functions
*********************************************************************
  + The miscellaneous identifier group has a variety of specialized
    and different functions.
  /m+puagtqlewxfnrdyzbo - miscellaneous modifiers
     p - allow match(s) only if directory is part of the DOS path. As
         the search progresses through the directory tree it checks to
         see if the directory in hand is in the DOS path, if not then
         no matches will be accepted in it. The DOS path is found
         within the environment variable "PATH".
     u - calculate and display bytes used by files/directories as a
         function of cluster usage. A cluster is the minimum size
         block used to write to disk. Cluster size increases as the
         total disk capacity increases. A 1.44Mb floppy has a 512byte
         cluster size and a 1.27Gb hard drive has a 32768byte cluster
         size. A 1000byte file would use 1024bytes on the floppy and
         32768bytes on the hard drive. If the program was unable to
         determine the cluster size for a particular drive then a
         value of -1 is displayed. Example being:
...........============..............................................
         7 [       512] -------a  12-19-1998  19:09:24   A:\FILE1.TXT
...........============..............................................

     a - display hex rendering of ASCII values in each filename. This
         function allows you to see any nonstandard filename
         characters that some programs may have written directly to
         the DIR entry.
         Example being "LSD a:\file1.txt /m+a":
.....................................................................
         7 -------a  12-19-1998  19:09:24   A:\FILE1.TXT
FILE1.TXT     46_49_4c_45_31_00_00_00 . 54_58_54
.....................................................................

     g - do not display the program's greeting message.
.....................................................................
LSD x.xx -- Freeware by Wayne Chestnut
** Allows directory LiSting recursively and to Delete files!!
.....................................................................

     t - use the alternate tree style (search subdirectories last).
         The default tree style is to drill down into the
         subdirectories as found. The default works best with DELTREE
         functions and the alternate makes a more coherent display.

         Alternate tree style example:
.....................................................................
         0 ---V---a  12-19-1998  19:09:14   A:\LABEL1
         0 --D-----  12-19-1998  19:09:16   A:\DIR1
         0 --D-----  12-19-1998  19:09:18   A:\DIR2
         7 -------a  12-19-1998  19:09:24   A:\FILE1.TXT
         7 -------a  12-19-1998  19:09:28   A:\FILE2.TXT
         7 -------a  12-19-1998  19:09:30   A:\FILE3.TXT
         5 -------a  12-19-1998  19:09:40  *A:\PROG.EXE
         5 -------a  12-19-1998  19:09:44  *A:\PROG.COM
         5 -------a  12-19-1998  19:09:46  *A:\PROG.BAT
        10 ----r--a  12-19-1998  19:09:48   A:\PROTECT1.FIL
        10 ----rhsa  12-19-1998  19:09:52   A:\PROTECT2.FIL
         0 --D-----  12-19-1998  19:09:20   A:\DIR1\DIR1_1
         0 --D-----  12-19-1998  19:09:22   A:\DIR1\DIR1_2
         7 -------a  12-19-1998  19:09:32   A:\DIR1\FILE1.TXT
         7 -------a  12-19-1998  19:09:34   A:\DIR1\FILE2.TXT
         7 -------a  12-19-1998  19:09:36   A:\DIR1\FILE3.TXT
         7 -------a  12-19-1998  19:09:38   A:\DIR1\DIR1_1\FILE1.TXT
        12 file(s)             4 dir(s)             1 label(s)
         3 exec(s)             0 inPath             9 nonexec(s)
        17 total              84 bytes
                        28401664 bytes left on drive C
.....................................................................

         Default tree style example:
.....................................................................
         0 ---V---a  12-19-1998  19:09:14   A:\LABEL1
         0 --D-----  12-19-1998  19:09:16   A:\DIR1
         0 --D-----  12-19-1998  19:09:20   A:\DIR1\DIR1_1
         7 -------a  12-19-1998  19:09:38   A:\DIR1\DIR1_1\FILE1.TXT
         0 --D-----  12-19-1998  19:09:22   A:\DIR1\DIR1_2
         7 -------a  12-19-1998  19:09:32   A:\DIR1\FILE1.TXT
         7 -------a  12-19-1998  19:09:34   A:\DIR1\FILE2.TXT
         7 -------a  12-19-1998  19:09:36   A:\DIR1\FILE3.TXT
         0 --D-----  12-19-1998  19:09:18   A:\DIR2
         7 -------a  12-19-1998  19:09:24   A:\FILE1.TXT
         7 -------a  12-19-1998  19:09:28   A:\FILE2.TXT
         7 -------a  12-19-1998  19:09:30   A:\FILE3.TXT
         5 -------a  12-19-1998  19:09:40  *A:\PROG.EXE
         5 -------a  12-19-1998  19:09:44  *A:\PROG.COM
         5 -------a  12-19-1998  19:09:46  *A:\PROG.BAT
        10 ----r--a  12-19-1998  19:09:48   A:\PROTECT1.FIL
        10 ----rhsa  12-19-1998  19:09:52   A:\PROTECT2.FIL
        12 file(s)             4 dir(s)             1 label(s)
         3 exec(s)             0 inPath             9 nonexec(s)
        17 total              84 bytes
                        28403712 bytes left on drive C
.....................................................................

     q - use case sensitive filemasks. The default is to convert all
         filemasks to uppercase before searching. This function uses
         filemasks exactly as typed. This is again related to the
         direct writing of some programs to the DIR entry.
     l - display line numbers at the beginning of the file
         information. Example being:
=======..............................................................
     1:         0 ---V---a  12-19-1998  19:09:14   A:\LABEL1
     2:         0 --D-----  12-19-1998  19:09:16   A:\DIR1
=======..............................................................

     e - echo or display the commandline before listing. This function
         might be useful when dumping output to a file to verify what
         switches and filemasks were on the commandline. Example
         being 'LSD a:\*.txt /m+e':
============================.........................................
C:\DOS\LSD.EXE a:\*.txt /m+e

         7 -------a  12-19-1998  19:09:24   A:\FILE1.TXT
         7 -------a  12-19-1998  19:09:28   A:\FILE2.TXT
         7 -------a  12-19-1998  19:09:30   A:\FILE3.TXT
         3 file(s)             0 dir(s)             0 label(s)
         0 exec(s)             0 inPath             3 nonexec(s)
         3 total              21 bytes
                        28395520 bytes left on drive C
.....................................................................
     j - echo or display date/time log at program start and end. This
         function might be useful when dumping output to a file to
         record the date and time of beginning of program execution
         and at the end of program execution.
     w - sound an alert when a match is found. Halt search, display a
         prompt, and sound an intermittent alarm until user
         acknowledges. On acknowledgement, if user hits the <Esc> key
         then the program aborts, the <Bksp> key disables alerts for
         the rest of the search, and the <Enter> key silences the
         alert until the next match. If you are in STEP MODE or
         SELECTIVE DELETION then the respective command prompt
         displays after acknowledgement of alert. This function might
         be useful if you know beforehand that the search will take a
         long time and you would like to do something else until a
         match is found.
     v - display file dates in Japanese format (CCYY-MM-DD). The
         default format is MM-DD-CCYY, i.e. month-day-year.
     x - display file dates in European format (DD-MM-CCYY). The
         default format is MM-DD-CCYY, i.e. month-day-year.
     f - filemask grouping (in set). Normally each filemask represents
         separate search through a directory tree. Using this function
         you may force each entry in the directory to be tested
         against each filemask in the list only once. DO NOT include
         any drive or path designations in the filemasks. Whatever
         directory is the current working directory is where the
         searching starts, i.e. execute LSD after changing to the
         start directory you desire. An exception occurs when
         combining with the '/drives+drivelist' function, here you do
         not need to be concerned with the start directory, it will
         be the root directories of each drive in the drivelist. Use
         of '/s' global subdirectory inclusion is honored, however use
         of '+' selective subdirectory inclusion is not valid, i.e.
         '+filemask'. All other switch filtering is honored. This
         function is primarily designed to reduce search time. Suppose
         you wanted to search 4 drives for 3 kinds of files; using
         'LSD /s /p /drives+cdef /m+f *.sys *.drv *.dll' the search
         would take 4 physical searches (one for each drive), without
         the '/m+f' switch this would take 12 physical searches (three
         for each drive, 4x3=12). Concerning summaries; do not depend
         on this function to tell you if a specific filemask match was
         found - only that at least one match was found or else no
         matches were found.
     n - filemask grouping (not in set). This function has all of the
         ground rules found in the 'f' operator. The only difference
         is that a match occurs when it DOES NOT fit one of the listed
         filemasks.
     r - force directory and label size to report as zero bytes.
         Labels and directories may show a size in bytes as a multiple
         of sector size (or other value) on CD-ROM disks. This function
         forces them to report as zero bytes to correct summary
         information.
     d - display hex rendering of DOS FCB for each entry. The DOS FCB
         is the file control block found in the directory entry. This
         function allows you to see a raw hex dump of that
         information. Gaps in the entry sequence numbers for a full
         directory listing may indicate the need to run a disk DEFRAG
         utility.
         An example being "LSD a:\file1.txt /m+d":
.....................................................................
         7 -------a  12-19-1998  19:09:24   A:\FILE1.TXT
drv:01 dir:0000 fil:0003 att:20 tim:13090C dat:120C13 siz:00000007
3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F FF A4 85 03 42
.....................................................................
         + The FCB consists of the following fields:
           reserved  - 21 characters
           attribute - 8 bits
           date      - 16 bits
           time      - 16 bits
           size      - 32 bits
           name      - 13 characters
         + The name field contains the 8.3 filename but is not
           repeated in the display.
         + The display is derived as follows:
           NOTE: ALL VALUES ARE EXPRESSED IN HEXADECIMAL.
           "drv:01" - this is the drive designation found in the first
           character in the reserved field.
           "dir:0000" - this is the directory code found in the 16th
           and 17th characters of the reserved field.
           "fil:0003" - this is the entry sequence number found in the
           14th and 15th characters of the reserved field.
           "att:20" - this is the attribute code found in the 8-bit
           attribute field.
           "dat:120C13" - this is the date code found in the 16-bit
           date field. It has been broken apart into bit fields as
           such:
           Years since 1980 Month   Day
           15.............9 8.....5 4.......0
           12               0C      13        = 12-19-1998
           "tim:13090C" - this is the time code found in the 16-bit
           time field. It has been broken apart into bit fields as
           such:
           Hours     Minutes     Seconds/2
           15.....11 10........5 4.......0
           13        09          0C           = 19:09:24
           "siz:00000007" - this is the size in bytes found in the
           32-bit size field.
           "3F 3F 3F 3F 3F 3F 3F 3F 3F 3F 3F FF A4 85 03 42" - This is
           the remainder of the reserved field; 2nd through 12th and
           18th through 21st characters. These fields are for internal
           use by DOS.
     y - display matches with invalid date stamp. This function will
         pass as a match any directory entry that has an invalid date.
         Invalid dates consist of the following:
         year < 1980 or year > 2099
         month < 1 or month > 12
         day < 1 or day > max; max = maximum number of days for that
         month (30, 31, 28, or 29) with leap years considered.
     z - display matches with invalid time stamp. This function will
         pass as a match any directory entry that has an invalid time.
         Invalid times consist of the following:
         hour < 0 or hour > 23
         minute < 0 or minute > 59
         second < 0 or second > 59
         seconds that are not even-numbered
     b - disable internal filemask editing. Normally the program will
         add additional information to certain filemasks, such as a
         directory name without wildcards/filename. Typing
         "LSD c:\dos" is edited to become "LSD c:\dos\*.*" (see
         GENERAL section below). This function prevents this editing
         and may be useful when you suspect the program has
         'corrupted' your meaning of a given filemask.
     o - show day of week in file date display. This will preceed the
         date display with a capitalized three-letter abbreviation for
         the day of the week, e.g. SUN, MON, etc. If for some reason a
         day of the week could not be calculated then '???' is
         displayed.


*********************************************************************
                      Exclude Filemasks Function
*********************************************************************
  /excl filemask1 [filemask2] - exclude the listed filemasks as
                                matches. This switch must follow all
                                of the other switches and filemasks on
                                the commandline. It must have at least
                                one filemask listed. DO NOT include a
                                drive or directory designation on a
                                filemask. The exclusion group applies
                                separately to each of the previous
                                filemasks. An example being:
                  "LSD /l+f c:\dos c:\windows /excl *.exe *.com *.bat"
                                This would list all of the files of
                                list type 'file' fitting the filemask
                                '*.*' except for '*.exe *.com *.bat'
                                in both the C:\DOS and C:\WINDOWS
                                directories.

,,,,,,,,,,,,,,,,,,,,
:    FILEMASKS     :
''''''''''''''''''''
The filemasks, [[[+]filemask1][[+]filemask2]...]:
- Multiple filemasks are allowed on the same commandline. Filemasks
  may designate different drives and/or directories and/or exact
  filenames. e.g. LSD c:\ a:\*.txt command.com d:\dos\h*.exe
- LSD incorporates the standard DOS filemasks plus two additional
  features:
  + LSD allows leading, embedded, and trailing asterdisks in both the
    filename and extension. In DOS the mask is truncated at the first
    asterdisk encountered; i.e. "*help.* = *.*", "de*m.*op = de*.*",
    "??*see.txt = ??*.txt", etc.
  + If a filemask is preceeded by a plus sign "+" then subdirectories
    are included in the search for that filemask, e.g. LSD +c:\dos. If
    the global subdirectory search is active (using /s) then any plus
    operator is ignored and all filemasks are searched subdirectory
    inclusive.
- The directory designation of '.' (current directory) is ignored
  entirely and not intentionally supported.
- The directory designation of '..' (parent directory) is supported
  but in a limited fashion as compared to the DOS DIR command. Parent
  directories can only be searched from the directory you were in when
  you first executed LSD. Suppose you were in the directory
  A:\DIR1\DIR1_1; typing "LSD ..\*.*" would list '*.*' in A:\DIR1,
  typing "LSD ..\..\*.*" would list '*.*' in A:\, typing
  "LSD ..\..\..\*.*" would be invalid as there is no third level back.
- Typing LSD alone on the commandline defaults to *.* for the current
  drive and directory. Suppose you are in the DOS directory on drive C
  and you type LSD, the effect is to have typed LSD c:\dos\*.*.
- LSD \ lists the root directory for the current drive using *.* and
  is equivalent to having typed LSD [drive:]\*.*.
- Typing 'LSD directoryname' is equivalent to 'LSD directoryname\*.*',
  e.g. LSD C:\DOS is equal to LSD C:\DOS\*.*.
- Ommiting the first backslash but including the drive in a filemask
  will append the path to the present working directory of the drive
  in question. e.g. Suppose drive A was presently in DIR1 and you type
  LSD a:*.* from drive C, the effect is to have typed LSD a:\dir1\*.*.
- Typing LSD \dos\*.* while in drive C is equivalent to having typed
  LSD c:\dos\*.*.
- Typing LSD dos\*.* while in the root directory of drive C is
  equivalent to having typed LSD c:\dos\*.*.

,,,,,,,,,,,,,,,,,,,,
:  DUMPING OUTPUT  :
''''''''''''''''''''
Dumping output to text file, [> or >> [drive:][path]filename]:
- This feature must be the last parameter on the commandline.
- Using the ">" operator will create/overwrite the specified file.
- Using the ">>" operator will create/append to the specified file.
- It is advised to not use this feature if the mode in use requires
  user input, e.g. STEP MODE, DELETE SELECT, VIEW SORTFILE, READ DISK
  SECTORS, or SYSTEM INFO.
- This feature is actually a function of the operating system, it
  redirects the screen output to the file (or device) specified.
  + If redirecting to a file then the drive and path (directory) are
    optional as long as you know where the file will be.
  + [> prn] OR [> lpt1:] will dump to the printer.
  + [> com1:] OR [> com2:] will dump to the specified serial port.
  + [> con] will dump to the video screen (not necessary).
  + [> nul] will dump to the nul device, i.e. no display is seen.

,,,,,,,,,,,,,,,,,,,,
:     GENERAL      :
''''''''''''''''''''
General notes:
- It may be helpful to print the quick reference section of this
  document as a guide until you become familiar with the commands.
- Because there are so many possible combinations and thus end results
  when using the various filters, it would be to your advantage to
  experiment with them before applying any delete switch to it. The
  more complex the logic, the more likely an undesired result.
- If you are going to run LSD.EXE from a floppy disk then it is
  advisable to have a copy of COMMAND.COM (or equivalent) on the disk
  with it. The command interpreter (command processor) should be of
  the same DOS version that was used when the system booted.
- LSD incorporates an emergency brakes feature for runaway listings
  and deletions. If you are in a runaway listing, you may abort the
  program by hitting <Esc> on the keyboard or you may force screen
  page pausing by hitting any other key. If you are using the
  miscellaneous summary-only feature and hit any key other than <Esc>
  then line display as well as screen page pausing is forced.
  Similiarly, if you are in a runaway deletion, you may abort the
  program by hitting <Esc> on the keyboard or you may force selective
  deletion mode by hitting any other key. If for some unlikely reason
  this fails then try CTRL+BREAK or CTRL+C on the keyboard to abort.
- A similiar braking feature is incorporated in the four functions
  that open each file and read it's contents. They are
  /find+..., /l+t, /l+u, and /y+csl. If a long file is being read, you
  may abort the program by hitting <Esc> on the keyboard or you may
  force that file to close and move on to the next one by hitting any
  other key (understand this makes the overall results inaccurate).
- To attempt to meet with Y2K (year 2000) compliance, file dates in
  the range of 01-01-1980 through 12-31-2099 are recognized as valid.
  The file's year is stored as a 7-bit field in the DIR entry. This
  value must be added to 1980 to derive a readable date. A full 7-bits
  means a maximum of 127, i.e. 1980+127 or 2107. However DOS will not
  accept setting the system clock's year to 2107. DOS did however
  accept setting the system clock up to 12-31-2099 (MS-DOS v6.22).
- LSD was written using Borland's Turbo C++ v3.0 editor, compiler, and
  linker. It utilizes the medium memory model; i.e. up to 1Mb code
  space and a 64K data and stack segment. The instruction set is
  entirely within the 8088/8086 CPU machine code.
- The default summary information is displayed as follows:
.....................................................................
        12 file(s)             4 dir(s)             1 label(s)
         3 exec(s)             0 inPath             9 nonexec(s)
        17 total              84 bytes
                        28403712 bytes left on drive C
.....................................................................

  + These are total counts for ALL of the filemask(s) combined.
  + The "file(s)" is the total count of matches that were neither
    directories or volume labels.
  + The "dir(s)" is the total count of matches that were directories.
  + The "label(s)" is the total count of matches that were volume
    labels.
  + The "exec(s)" is the total count of "file(s)" that were also
    executables. Executables being defined as having extensions of
    BAT, COM, or EXE. NOTE: In the individual listing, the filename
    that is an executable is preceeded by an asterdisk '*' in the
    display.
  + The "inPath" is the total count of "exec(s)" that resides in a
    directory that lies within the DOS path. NOTE: In the individual
    listing, the filename that is an executable that also lies within
    the DOS path is preceeded by two asterdisks '**' in the display.
  + The "nonexec(s)" is the total count of "file(s)" that were not
    executables ("exec(s)").
  + The "total" is the total count of matches, i.e. the total count of
    "file(s)", "dir(s)", and "label(s)" combined.
  + The "bytes" is the sum of the bytes used by all of the matches.
    Directories and volume labels are interpreted as using zero bytes.
  + The byte count preceeding "bytes left on drive C" is the disk
    space remaining on the current drive and not necessarily from the
    drive being listed.

