What is a direct path in DOS?

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Can you put this into more context, not sure what your looking for... Short of that a direct path is the same as the full path (e.g. c:\directory\file is a direct path, 'file' is not)

Bill
 

InlineFive

Diamond Member
Sep 20, 2003
9,599
2
0
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.
 

BlueWeasel

Lifer
Jun 2, 2000
15,944
475
126
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?
 

Churnd

Member
Dec 7, 2004
111
0
0
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 ;
 

Matthias99

Diamond Member
Oct 7, 2003
8,808
0
0
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?

I've never heard of this term. And I used DOS pretty extensively back in the day. Closest thing I could find was this (from this website):

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.

(emphasis added)

Maybe a "direct path" is a relative path that doesn't loop back on itself at any point? And/or that doesn't go through the root directory of the drive?

Example: if you had two directories in C:\, dir1 and dir2, and files file1.doc and file2.doc in those respective directories. If you're in the root, "dir1\file1.doc" is a direct path, but if you're in dir2, "..\dir1\file1.doc" is not (it is a relative path, though). That's about the only thing I could conceivably come up with. I've seriously never heard of the term before in relation to any operating/file system.
 

InlineFive

Diamond Member
Sep 20, 2003
9,599
2
0
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 ;

I don't think this has anything to do with the PATH command. Thanks for such a descriptive answer though. :)

Originally posted by: ColKurtz
Is this for an Archaic Operating Systems 101 class or something? :)

How did you know? ;)

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?

As far as I can find the Absolute path is a full link and a relative path is a partial link from an object's current location. That was for HTML however but that was the best I could find.
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
I did find some discussion of direct paths in the context of an absolute path via symbolic links removed (e.g. there can be a number of absolute paths to a file going thru sym links, the direct path is the true path to the file). Problem is that definition doesn't apply to DOS and doesn't really work on NTFS....
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0

Given the ambiguity and silliness of this question I'm guessing the correct answer is probably:

Any path that begins with "\"

Anything else that begins with a folder name including . and .. will be relative paths, not direct aka absolute.
 

micnn

Member
Feb 25, 2003
148
0
0
Actually, taken from precious posts, also in the context of abs. and rel. path, I can only think of PATH environment being a meaningful guess as direct path.

i.e., how do you locate a file on the system?

1. by the method of abs. path
2. by the method of rel. path
3. if the file is under the PATH environment, then no method will be needed. Thus, direct path.

Let us know...