ITPEC IP October 2019 Question 22
As shown in the directory structure below, when D3 marked by an asterisk (*) is the current directory, which of the following the appropriate directory path that can designate file A under directory D4 marked by an arrow? Here, a file is designated as follows:
Explanation
..\D2\D4\A — go up from D3 to the common parent D1, then down through D2 to D4.
D3 and D2 are both directly under D1, so one .. takes the reference from D3 to D1. From D1, the path goes down to D2, then D4, and ends with the file name: ..\D2\D4\A.
Answer (b)
Why not others:
- •(a) — the second
..moves above D1, where there is no D2 as shown - •(c) — it does not start with
\,.or.., so by rule (5) it is read as.\D1\D2\D4\A, a D1 under D3, which does not exist - •(d) — by rule (5) it is read as
.\D2\D4\A, looking for D2 under D3, but D2 is under D1
Key rule: A relative path climbs with .. to the nearest common ancestor of the current directory and the target, then names each directory on the way down.
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.