SpartaDOS X Reference Manual

The Command Processor — Commands




PATH (Set Search Directory) Command

Index


Purpose

Causes specified directories to be searched for commands before searching the current directory.
 

Syntax PATH [path_string]
 
Type Internal
 
Related CAR, CHDIR, MKDIR, PROMPT, RMDIR
 
Remarks

You may specify a list of drives and path names separated by semicolons. Then when you enter a command, SpartaDOS searches the named directories in the sequence you entered them (from path_string) before searching the current directory of the drive that was specified (or implied). The current directory is not changed after the search.

Entering PATH with no parameters causes SpartaDOS to display the current setting of the PATH string.

It is recommended that you include "CAR:" as a device in the search path as this device contains many external commands (such as X, CAR, MENU, DUMP, CHTD, etc.) that you may need. It is also good practice to use ">" or "\" at the start of a device path to force a start at the MAIN directory. The command:

    PATH A:>;1:>DOS;CAR:

sets the search to the root directory of drive A (alias drive D1:), the "DOS" directory of drive 1, and the CARtridge directory.

The PATH command is really just a convenient form of the SET command, for example the above command could also be performed by:

    SET PATH=A:>;1:>DOS;CAR:

The only way to clear the search path to search just the current directory (i.e no search path at all) is the command:

    SET PATH

Where no path has been specified, the system defaults to:

    PATH CAR:

This means search the CAR: device first, then search the current directory. The current directory will always be searched last unless it is included in the path_string. e.g.

    PATH ;CAR: or PATH :;CAR:

The previous examples both mean the same thing; search current directory first, then CAR:, then current directory again. (Remember that current directory is always searched last even if it was already searched.) The stand alone ":" or a space, indicate the current directory.

NOTE: While not required, it is strongly recommended that CAR: always be the first entry in the path string. The programs in this directory are called often. If any other devices are listed first, they will always be checked before the CAR: device, slowing system response considerably.

For more information, see the SET command in chapter 5.


Previous page

Next page