The file system provides the mechanism for online storage of and access to both data and programs of the operating system and all the users of the computer system. The file system consists of two distinct parts: a collection of files, each storing related data, and a directory structure, which organizes and provides information about all the files in the system.
A file is a collection of related information that is recorded on secondary storage. From a user’s perspective, a file is the smallest allotment of logical secondary storage and data can not be written to secondary storage unless they are within a file.
Four terms are in common use when discussing files: Field, Record, File, and Database
- A field is the basic element of data. An individual field contains a single value, such as an employee’s last name, a date, or the value of a sensor reading. It is characterized by its length and data type.
- A record is a collection of related fields that can be treated as a unit by some application program. For example, an employee record would contain such fields as name, social security number, job classification, date of hire, and so on.
- A file is a collection of similar records. The file is treated as a single entity by users and applications and may be referenced by name.
- A database is a collection of related data. A database may contain all of the information related to an organization or project, such as a business or a scientific study. The database itself consists of one or more types of files.
A file has the following attributes:
- Name: The symbolic file name is the only information kept in human-readable form.
- Identifier: This unique tag, usually a number, identifies the file within the file system; it is the non-human-readable name for the file.
- Type: This information is needed for those systems that support different types.
- Location: This information is a pointer to a device and to the location of the file on that device.
- Size: The current size of the file (in bytes, words, or blocks), and possibly the maximum allowed size are included in this attribute.
- Protection: Access-control information determines who can do the reading, writing, executing, and so on.
- Time, date, and user identification: This information may be kept for creation, modification and last use. These data can be useful for protection, security, and usage monitoring.