- Sep 20, 2003
- 9,599
- 2
- 0
Originally posted by: PorBleemo
I am supposed to be looking for the definitions of absolute, relative and direct paths for DOS. I found the first two but it's almost impossible to find the third.
Originally posted by: ColKurtz
Is this for an Archaic Operating Systems 101 class or something?![]()
Originally posted by: BlueWeasel
Originally posted by: PorBleemo
I am supposed to be looking for the definitions of absolute, relative and direct paths for DOS. I found the first two but it's almost impossible to find the third.
Odd...I would expect the absolute and direct paths to be the same thing.
Are you referring to "true" DOS or a DOS command line from within Windows?
There are two different ways to access a specific file. We will use REPORT.DOC in the DATA subdirectory of the WP directory in Figure 1 as an example. One method of accessing the file is to specify the complete path from the root directory to the file and this is referred to as an absolute specification. The complete filename would be \WP\DATA\REPORT.DOC. The leading back slash, \, tells DOS that the path starts from the root directory. The remaining back slashes are used simply as separators between directory names. Pathnames (filename plus path) which provide an absolute specification can be used to access any file from any current directory.
The second method of accessing the file is to define the filename relative to the current directory, a relative specification. In a relative specification, the first directory named in the path is a child of the current directory and there is a direct path from the current directory to the desired directory that does not go through the root. If we are currently in the root directory, the file specification would be WP\DATA\REPORT.DOC. If the current directory is WP, the file specification would be DATA\REPORT.DOC. If the current directory is the DATA directory, the file specification would be simply REPORT.DOC. Note that none of these pathnames start with a back slash.
Originally posted by: Churnd
Taken from this website: http://www.strath.ac.uk/CC/Courses/DOS/#label33
PATH - creates a search path
For many DOS commands (viz. external commands) there is a program file which has to be executed in order for the command to work. In the examples so far we have assumed that this is not a problem but in fact DOS has to know where on disk, i.e. in which directory, the corresponding program file is. If it cannot find the file then the command will fail.
By default DOS will only look in the current directory for this program/executable file. If it is not there then DOS has to be know the path (i.e. the hierarchy of directories from the root) to it.
This can be achieved by prepending the relevant path to the command name whenever composing a command line. However it would be better if DOS could simply be told in which directories to look for program files whenever a command name was entered. This can be achieved by using the PATH command. It enables you to specify the path to directories DOS should search, after the current directory for the program file for a command. Once this command has been issued DOS will remember these directories until the command is used again either to clear the search path or set a new search path, or until the machine is switched off.
Command Syntax: PATH DRIVE:\PATH
You can have multiple occurrences of DRIVE:\PATH each separated by ;
Example 1: Set a path to \ (the root directory), and the DOS directory
PATH C:\;C:\DOS
This instructs DOS that after it has searched the current directory for a program file, it should then search the root directory of C: and then the DOS subdirectory of the root.
This should be a minimum search path when using DOS because most of the DOS program files are usually kept in the DOS subdirectory and the root directory. It allows the DOS commands to be used, as in these notes, without prepending them with a path.
A search path containing at least these elements is usually set up in the AUTOEXEC.BAT.
Example 2: Add the directory MEMOS on the diskette to the search path
PATH C:\;C:\DOS;A:\MEMOS
You can also use the PATH command to see what directories are currently in the search path, and to clear it.
Example 3: Display the current search path
PATH
Example 4: Clear the search path
PATH ;
Originally posted by: ColKurtz
Is this for an Archaic Operating Systems 101 class or something?![]()
Originally posted by: BlueWeasel
Originally posted by: PorBleemo
I am supposed to be looking for the definitions of absolute, relative and direct paths for DOS. I found the first two but it's almost impossible to find the third.
Odd...I would expect the absolute and direct paths to be the same thing.
Are you referring to "true" DOS or a DOS command line from within Windows?