ITPEC IP April 2026 Question 20
When directories d1 and d2 are placed on a web server as shown in the figure, which of the following descriptions specifies the reference of the web page file f2.html on directory d2 from the web page file f1.html on directory d1 (current directory)? Here, the reference method of files is shown as below.
Explanation
../d2/f2.html — go up from d1 to the root with “..”, then down into d2.
The current directory is d1, and d1 and d2 are siblings under the root. By rule (3), .. moves one level up, from d1 to the root. By rule (1), the path then names the directory d2 and the file f2., separated with a slash. The reference is ../d2/f2.. The form starting from the root by rule (4), /d2/f2., is not offered.
Answer (c)
Why not others:
- •(a) —
./d2/f2.starts from the current directory d1 and looks for a d2 inside d1, which does not existhtml - •(b) —
./f2.looks for f2.html in d1 itself, which holds only f1.htmlhtml - •(d) —
d2/../f2.goes down into a d2 below d1 and straight back up to d1, so it still means f2.html in d1html
Key rule: In a relative path . is the current directory and .. its parent; to reach a sibling directory, go up with .. and then down by name.
Software · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.