ファイルシステムに関する次の記述中の a~c に入れる字句の適切な組合せはどれか。 PC でファイルやディレクトリを階層的に管理するとき,最上位の階層に当たるディレクトリを [ a ] ディレクトリ,現時点で利用者が操作を行っているディレクトリを [ b ] ディレクトリという。[ b ] ディレクトリを基点としてファイルやディレクトリの所在場所を示す表記を [ c ] パスという。
平成23年度 特別試験 ITパスポート試験 問83
This question's explanation and your answers so far.
問 83
Incorrectア
This is the combination a: Current, b: Root, c: Absolute, and the first error is that a and b are swapped. The current directory is the directory of the position where the user is operating at this moment; it does not carry the meaning of the topmost level of the hierarchy, so it cannot go in a. Conversely, the root directory is fixed at the topmost level of the hierarchy and does not change according to where the user is working, so it cannot go in b either. Furthermore c is also wrong: an absolute path is a notation that uses the root directory as its starting point, whereas the question text clearly states that the starting point is the directory in b (correctly, the current directory), so Absolute does not fit here. All three are wrong.
Incorrectイ
This is the combination a: Current, b: Root, c: Relative. Relative in c is correct as a word, but a and b are swapped just as in ア, so the choice is not appropriate. If this combination is put into the question text, the directory at the topmost level would be called the current directory and the directory in which the user is operating at this moment would be called the root directory, completely reversing the definitions of the two terms. In addition, if b stays as Root, then the notation that uses the [ b ] directory as its starting point becomes a notation based on the root directory, that is, the description of an absolute path, which no longer agrees with Relative in c either.
Incorrectウ
This is the combination a: Root, b: Current, c: Absolute. Here a and b are correct and only c is wrong. This choice tests the distinction between an absolute path and a relative path, and it is the most confusing trap. An absolute path is a notation that starts from the root directory and writes out the entire route from the topmost level to the target file, so it points to the same object with the same notation no matter which directory you are working in. What the question text describes, however, is a notation that uses the [ b ] directory, that is, the current directory, as its starting point, and that is the definition of a relative path. Since the starting point is not the root but the current directory, Absolute cannot go in c.
- エ
正解 The correct answer is エ (a: Root, b: Current, c: Relative). All three blanks can be determined one by one straight from the definitions given in the question text. First, a is described as the directory at the topmost level. A file system manages files with a tree structure (hierarchy) of nested directories, and the topmost directory at the root of that tree, beyond which you cannot go up any further, is called the root directory. On Windows this is C:\, and on UNIX-like systems it is /. Therefore a is Root. Next, b is described as the directory in which the user is currently operating. The directory that shows where the user is working at this moment is called the current directory (working directory); it changes when you move with a command such as cd, so it is in effect your present location. Therefore b is Current. Finally, c is described as the notation that indicates the location of a file or directory using the [ b ] directory as the starting point. The decisive point here is that the starting point is b, that is, the current directory. There are two ways of writing a path: writing out the whole route from the top with the root directory as the starting point is an absolute path, while writing only the difference from there with the current directory as the starting point is a relative path. A relative path uses . (one period) for the directory itself and .. (two periods) for the parent directory one level up, and is written for example as ..\data\a.txt. Since the starting point is the current directory, c can be nothing other than a relative path. Putting all of this together gives a: Root, b: Current, c: Relative, and the only row in the combination table of the figure that matches is エ.
- Root directory and current directory — a file system manages files with a hierarchical (tree) structure of nested directories. The fixed directory at its topmost level (the root) is the root directory (C:\ on Windows, / on UNIX-like systems), and the directory of the position where the user is working at this moment is the current directory (working directory), which changes when you move with an operation such as cd.
- Absolute path and relative path — notations for a location are distinguished by their starting point. Writing the whole route from the topmost level with the root directory as the starting point is an absolute path; writing only the difference from there with the current directory as the starting point is a relative path. In a relative path, . stands for the directory itself and .. stands for the parent directory one level up.