Sections: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Index | Next >
Learning objective: Explain the use of relative paths
To copy a file using only relative references, imagine starting from ENG104 as the current or working directory and providing the path from this location to the target destination. It is up to the user to know the full source and destination paths when executing this command. In this example, if we wanted to copy a file from ENG104 directory to the Backup directory, the command would be: COPY file dot-dot\dot-dot\Backup. This assumes that we are currently in the ENG104 directory. The dot dot would move you up one directory. (Remember, there is only one way to go up the tree. If enough dot-dots are given, you will return to the root directory.) When the path gets to the root or pivot point, the full path is given to identify the downward direction to the destination. When paths are identified, the system will follow them down to that location.
COPY file [space] ..\..\Backup
Other examples:
To copy a file from the Personal directory (as the working directory) to the School directory:
COPY file.txt [space] ..\School
To copy a file from the ENG104 directory (as the working directory) to the CMPTR111 directory:
COPY file.txt [space] ..\CMPTR111
To copy a file from the ENG104 directory (as the working directory)to the root:
COPY file.txt [space] ..\..
Thinking: If all paths start at the working directory as the reference, what are the benefits?
Key terms: directory, file, path, relative path, root
Resources:
To maximize your learning, please visit these Web sites and review their content
to help reinforce the concepts presented in this section.
Quick links:
Relative path @ Wikipedia
Notes on navigation: Click inside the frame to navigate the embedded Web page. - Click outside the frame to navigate this page to scroll up/down between the embedded Web pages. - Click on the frame title to open that page in a new tab in most browsers. - Click on the the "Reload page" link to reload the original page for that frame.
Relative path @ Wikipedia |
Reload page
|
If frame is empty, click on the link to view the page in a new tab or window
Sections: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Index | Next >