PCのファイルシステムの役割として, 適切なものはどれか。
平成22年度 秋期 ITパスポート試験 問67
This question's explanation and your answers so far.
問 67
- ア
正解 The correct answer is ア. A file system is the mechanism an OS provides for managing data on secondary storage in units of files and directories (folders). Hard disks, SSDs, DVDs, USB flash drives and the like differ from one another both in the principle by which they record data and in how the physical positions where the data is actually placed are counted (sectors, tracks, cluster sizes). The file system absorbs those differences and shows an application program only a common procedure — open a file by its file name, read and write it, then close it — that is, a single unified interface. Thanks to this, the application does not have to write code that distinguishes whether the target is a file on a hard disk or a file on a DVD; it can handle both in the same way with the same commands. Providing this abstraction, which lets programs access files without being aware of differences between storage media, is the central role of a file system, and ア states it correctly.
Incorrectイ
Taking the CPU away from a program that has stopped while waiting for input/output to finish, and assigning it to another program that is ready to run, is the role of the OS's task management (process management); the part that actually assigns the CPU is called the dispatcher. This is precisely the idea of multiprogramming — not letting the CPU sit idle during the waiting time of slow input/output — and it is not the work of the file system. It is confusing because the wording mentions file access, but the subject of the statement is how the CPU is allocated, not how files are managed, and on that point it is wrong.
Incorrectウ
A file system only stores and passes along the contents of a file as a byte sequence exactly as they are; it neither interprets which character encoding (Shift_JIS, UTF-8, and so on) the data inside is written in, nor converts it automatically. Deciding which character encoding to read it as is the job of the application program that opens the file. Garbled text appears when you open a file written in a different character encoding precisely because the file system does not convert it, so this statement does not hold.
Incorrectエ
Checking whether a file is infected with a virus before it is opened is the real-time scanning function of anti-virus software, not a function of the file system. The file system makes no evaluation at all of whether a file's contents are safe or harmful; it simply mediates reading and writing exactly as requested. Updating the virus definition file on which such scanning depends is likewise a role carried out by the anti-virus software.
- The role of a file system is to hide the management of physical recording positions on secondary storage and to offer applications a logical view made up of file names and directories, together with a unified interface of open, read, write and close. Because of this, a program does not have to be aware of differences between storage media such as hard disks, DVDs and USB flash drives.
- Memorize the OS's functions sorted by role: allocating the CPU to a runnable program is task management (the dispatcher), allocating main memory and handling virtual memory is memory management, and managing files is the file system. Character-encoding conversion is the application's responsibility and virus checking is the anti-virus software's; neither belongs to the OS file system.