ITPEC IP April 2024 Question 17
In a file system with the hierarchy structure shown in the Figure, when “..\..\DIRB\Fn.txt” is specified from the directory marked with an * (the current directory), which of the following is the file that is referenced? Here, blank in the Figure show the directory name, and the reference method for a file is as below.
Explanation
Fn.txt at (4) — up two levels to the DIRB directly under Root, then down into its subdirectory DIRB.
The current directory, the one marked with an asterisk, is Root\DIRB\DIRA\DIRB. Resolve ..\..\DIRB\Fn. one part at a time:
Answer (d)
Why not others:
- •(a) — (1) is in the current directory itself,
.\Fn.; the twotxt ..steps leave it - •(b) — (2) is directly in
Root\DIRB, where the two..steps end; reaching it would take..\..\Fn., without thetxt DIRBstep - •(c) — (3) is one level deeper, in
Root\DIRB\DIRB\DIRB; reaching it would take..\..\DIRB\DIRB\Fn.txt
Key rule: Resolve a relative path left to right from the current directory: each .. goes up one level and each name goes down into that child, so the same name at different levels is a different directory.
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.