ITPEC FE Morning October 2018 Question 19
Multiple directories named A and B are managed in the structure shown in the figure below. Which of the following is the case in which the current directory is moved so that “\B\A\B” is the current directory? Here, the method for directory designation is as below, and → indicates the order of movement.
Explanation
\A → ..\B → .\A\B — the moves go to \A, up to the root and into \B, then down through A and B to reach \B\A\B.
A reference starting with \ starts at the root, .. goes up one level, . is the current directory, and a bare name is relative to the current directory.
- •
\A— from the root: current is\A - •
..\B— up from\Ato the root, then intoB: current is\B - •
.\A\B— from\BintoA, thenB: current is\B\A\B
Answer (a)
Why not others:
- •(b) —
\B, then.\B\Agives\B\B\A, and..\Bgoes up to\B\Band ends at\B\B\B - •(c) — every step starts with
\, so each is taken from the root and the last one leaves the current directory at\B - •(d) —
\B\A, then..\Bgoes up to\Band ends at\B\B, one level short
Key rule: Trace a path step by step from the current directory: a leading \ resets to the root, .. removes the last name, and each name adds one level.
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 FE past-paper collection or Report an issue.