Problem 2 (8 points): Answer the following questions about absolute and relative
ID: 3849289 • Letter: P
Question
Problem 2 (8 points): Answer the following questions about absolute and relative filenames:
a) What is the difference between an absolute filename and a relative filename?
b) Assume you have a directory containing a computer program. This program reads and writes to a file that is always located inside this same directory. If you are going to be moving the directory to different locations on your computer, should you use an absolute or relative filename to refer to that file?
c) Would directory/files/ be considered absolute or relative?
d) Would /important_files/File16.txt be considered absolute or relative?
e) Would /opt/code/calculator.rb be considered absolute or relative?
Explanation / Answer
A1) Absolute file name uses the complete directory tree structure starting from the root of the directory to the directorywhere the file is located in the tree structure either in UNIX or WINDOWS systems.
2) Relative file name dont require the root, just the directories like current (.), or parent like (,,) or (./child) child directory by name child available in curent directory.
B) Either can be used if no conflicting(same name) is available in the tree structure.
C) Relative because it refers the name directory in the current directory.
D) Absolute because first letter (/) mentions the root.
E) Absolute because firest letter / memtions as root in unix/linux.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.