Summary

This document discusses file management, including file systems, file organization strategies, and fundamental operations. Information about data organization, records, fields, and files along with different file organization techniques like sequential files, indexed files, direct/hashed files is included.

Full Transcript

IT2105 File Management Aside from the means to store organized data, file systems also encompass a File Systems collection of functions that can be performed on...

IT2105 File Management Aside from the means to store organized data, file systems also encompass a File Systems collection of functions that can be performed on files that generally includes A file system is an organization of data as files and directories, with a file- the following fundamental operations (Stallings, 2018): based interface and file permissions to control access. This may also include Create: A new file is defined and positioned within the file structure. special file types for devices, sockets, and metadata. A file system interacts Delete: A file is removed from the file structure and subsequently be with applications. It can utilize caching, buffering, and asynchronous I/O to obliterated. avoid subjecting applications to disk-level latency (Gregg, 2021). The following Open: An existing file is opened by a process allowing the process to are some of the desirable properties of a file system (Stallings, 2018): perform other operations on the file. Long-term existence: Files are stored on disk or on other secondary Close: An existing file is closed with respect to a process so that the storage that must not disappear when a user logs off. process may no longer perform any operation on the file. Sharable between processes: Files have names and associated access Read: A process reads all or a portion of the data in the file. permission that permit controlled sharing. Write: A process updates a file either by adding new data that may Good structure: A file can have an internal structure that is suitable for increase the file size or by changing values of existing data items in the particular applications. Files can be organized into a hierarchical or more files. complex structure that reflects the relationship among files. File systems maintain a set of attributes associated with the files in the The following terms are commonly encountered and used when discussing file structure. These attributes may vary from one operating system to another but systems (Stallings, 2018): generally consists of the following (Silberschatz, Galvin & Gagne, 2018): Field – This is the basic element of data. An individual field contains a File name – It is a symbolic name for a file that is kept in human-readable single value characterized by its length and data type. The length of a field form. can either be fixed or variable. Variable field length often contains two (2) Identifier – It is a unique tag that identifies a file within the file system. or three (3) subfields. A field may contain values such as date, last name, File type – This information is needed for systems that support different or sensor reading value. types of files. Record – This is a collection of related fields that can be treated as a unit Location – This serves as a pointer to a device and to the exact location by an application or a program. The length of a record may also be fixed of the file on a particular device. or variable. A good example of a record is an employee record that usually File size – It is the current size of a file in bytes, words, or in blocks. contains such fields as name, social security number, job classification, Protection – It pertains to the access control information of the file that date of birth, and gender. determines who can read, write, or execute other operations on the file. File – This is a collection of similar records. A file is treated as a single Timestamp – This information usually involves the time of creation, last entity by users and applications and may be referenced by name. modification, and last access time that are used for security and Fundamental operations can be performed on a file. Access control monitoring. restrictions usually apply at the file level. In a more sophisticated system, such restrictions are enforced at the record or even at the fields level. File Organization Database – This is a collection of related data. The relationships that exist File organization pertains to the logical structure of records as determined by among data elements are explicit and the possible applications widely the way in which they are accessed. The physical organization of the file on vary. This may contain all the information related to an organization or a secondary storage depends on the blocking strategy and the file allocation project, such as a business or a scientific study. Note that a database may strategy. The following criteria are significant in choosing a file organization consist of one or more types of files. (Stallings, 2018): o Short access time 08 Handout 1 *Property of STI  [email protected] Page 1 of 2 IT2105 o Ease of update placement are imposed as long as a pointer in at least one index refers o Economical storage to that record. Two (2) types of indexes are usually used in this o Simple maintenance structure: o Reliability  An exhaustive index that holds one (1) entry for every record in the main file; and The relative priority of these criteria greatly depends on the applications that  A partial index that holds entries to records where the field of utilize the file. Conflicts between these criteria may also arise. On the other interest exists. hand, redundancy is a primary means of increasing the speed of data access. Indexed files are mostly used in applications where the timeliness of The alternative structures that have been proposed and/or implemented in the information is critical and where data are rarely processes industry widely vary. Below are the five (5) common file organizations exhaustively, such as airline reservation systems and inventory (Stallings, 2018): control systems. 1. Pile – This is the least complicated form of file organization. Data are 5. Direct/Hashed File – This file organization exploits the capability collected in the order in which they arrive. Files are technically found on disks to directly access any block of data with known unstructured. It is necessary to examine each record in the pile until address. The concept of sequential ordering is not observed in this the desired record or file is found. The purpose of a pile structure is structure. Direct files are often used where very rapid access is simply to collect and save data. This structure is usually encountered required, where fixed-length records are used, and where records are when data are collected and stored prior to processing, when data constantly accessed one at a time. does not require to be organized, or when data are not easy to organize. Since this structure only has limited uses, it is unsuitable for References: Gregg, B. (2021). System performance: Enterprise and Cloud (2nd ed.). Pearson Education, Inc. most applications. Silberschatz, A., Galvin, P. & Gagne, G. (2018). Operating systems concepts (10th ed.). John Wiley & Sons, Inc. 2. Sequential file – This is the most common form of file organization, Stallings, W. (2018). Operating systems: Internal and design principles (9th ed.). Pearson Education Limited since it implements a fixed format for records. All records are of the same length, containing the same number of fixed-length fields in a particular order. A key field uniquely identifies the record; thus, the key values for different records are always different. It is usually used in batch applications and is generally optimum for applications that involve the processing of all data records. This structure can easily be stored on tape or on disk. 3. Indexed sequential file – This is a well-known approach to overcome the disadvantages of a sequential file structure. While records are organized based on a key field, two (2) features are added: a file index to support random access and an overflow file. The file index provides a lookup capability to quickly reach the vicinity of a desired record, while the overflow file is integrated so that a record in it can be located by following a pointer from its predecessor record. This structure greatly reduces the required time in accessing a single record without sacrificing the sequential nature of the file. 4. Indexed file – This file organization encompasses multiple indexes, one for each type of field that may be the subject of a search. Records are accessed only through their indexes, and no restrictions on their 08 Handout 1 *Property of STI  [email protected] Page 2 of 2

Use Quizgecko on...
Browser
Browser