The SUBDIR programs were created for use on the LDOS 5.x operating system by
person or persons unknown.  I have endeavored to clean up the code, enhance
them, and port them to the TRSDOS/LSDOS 6.x operating system.  MKDIR5, CD5,
PWD5, and RMDIR5 are ORGed at 5200h and will run under LDOS 5.x (with SVC table
installed) or DOS 6.x, MKDIR6, CD6, PWD6, and RMDIR6 are ORGed at 2600h, load
into the system library overlay region (2600h-2fffh), and run under DOS 6.x
only.  Both versions are compatible with use of the @CMNDR SVC (#25).

I have made the following significant changes (from a user standpoint):

    The PDS bit (DIR+0 bit 5) is set by MKDIR when it creates the subdirectory
    for better security during CD and RMDIR.  Because of this, CD and RMDIR
    will not recognize subdirectories created by the earlier version of MKDIR.
    MKDIR, CD and RMDIR enforce the use of the /DIR extension and PDS bit.  Use
    of the /DIR extension is optional, the programs will add it themselves, but
    if an extension is used, it MUST be /DIR.

    The path delimiter has been changed from a slash ('/') to a backslash ('\')
    in CD and PWD.  This is to make the addition of an extension possible
    without conflict with the path in any future extensions of these utilities.

    RMDIR no longer requires a password be given, checks for the extension and
    PDS bit give sufficient security.

    In CD, if the path starts with the delimiter ('\') it start searching for
    the path from DIR/SYS, otherwise it will search from the current directory.
    This is the opposite of how the original CD worked, but is more in keeping
    with paths in other operating systems.

The function of the programs is to create sub-directories similar to those in
the MS-DOS operating system.  This allows better control over program
placement,etc...  Below are listed the individual programs and their functions.
On all of these, filespec refers to the subdirectory to be made/changed to/
removed, d refers to the drive it is on (which defaults to 0 if not given), and
path is an optional path to the subdirectory.  If the path starts with the path
delimiter, then the path starts with DIR/SYS, otherwise it will start with the
current directory.

MKDIRx/CMD - Creates the subdirectory.  Format is MKDIR filespec:d[(CYL=n],
where CYL is an optional parameter specifying the number of cylinders to assign
in addition to the directory cylinder (default=10, abbreviation=C).  These
cylinders are pre-allocated in the parent directory and can only be used by the
subdirectory.  If insufficient free tracks are available in the parent
directory, MKDIR will abort.  The drive will default to 0 is none is given.
Access to SYSx/SYS files will be maintained if they are present when the
subdirectory is created.  You may make subdirectories within subdirectories if
you make the cylinder count smaller on the daughter directory.

CDx/CMD - Change directory.  This program allows you to switch between
different directories on one disk.  The format is CD [path\]filespec:d.  If you
are in a sub-directoryand you wish to return to the normal directory, just
enter CD :d.  If the path starts with a '\', then it is considered to start
from dir/sys, otherwise it is considered to start from the current directory.
The drive will default to 0 if none is given.  DO NOT change directories with
files open - the only files accessible across subdirectories are the SYSx/SYS
files IF they were present when the subdirectory was made.

PWDx/CMD - Paths of Working Directories.  Shows you the paths of the
directories like the MS-DOS command, PATH.  It shows all logical drives and
the current active directory on that drive.  If you are just using the regular
directory, it displays \.

RMDIRx/CMD - Remove directory.  The program removes the program from the disk.
The format is RMDIR filespec:d, where filespec is the name of the directory to
be removed and d is the drive.  You must be in the parent subdirectory to
remove a subdirectory.  The drive defaults to 0.

I've taken this about as far as I intend to at this point, since I generally
use diskDISK, which fits my needs well.  I am including the source code in MRAS
compatible format for anyone who wants to take this further.  I can see the
following areas for improvement:

    Support for the .. shorthand for parent directories could be added in the
    path processing.

    MKDIR could be tightened up more and support for a path to the target
    directory added.  (It nearly fills the overlay region now, so the code
    would have to be tightened up before the path support was added.)

    RMDIR could have support for a path to the target directory added.

    A TREE utility could be written.

    An ECI could be written that would allow execution of programs on
    non-active subdirectories by stating the path to them.

Anything beyond this would require major changes at the operating system level,
which is not likely to come from Misosys or LSI, or else a library of routines
for accessing files on different subdirectory levels that could be linked into
a program.

Original program documentation by Mike Teegarden.  Programs and documentation
revised by Richard VanHouten 3/3/90.

As far as I know, the original versions were in the public domain; I hereby
release my changes to them to the public domain.

If you have questions, I can be reached at:
Richard VanHouten
21 Grandview Ave.
Port Jervis, NY 12771
Voice: (914)856-6883 (evenings and weekends)
BBS:   (914)858-8722 (300/1200 baud, 24 hour)

3/10/90  I found out today (after someone called to tell me he couldn't get CD6
to work) that CD didn't work in dos6 and RMDIR didn't work in ldos5, so
I fixed both versions of CD and RMDIR to work properly in both modes.
