File Management PDF
Document Details
Uploaded by Deleted User
Tags
Summary
This document provides an overview of file management concepts, including file systems, attributes, and different organization types. It explains the fundamental operations and various attributes of files, with examples to aid understanding.
Full Transcript
FILE MANAGEMENT o Open: An existing file is opened by a process allowing the process to perform other operations on File Systems the file. A fi...
FILE MANAGEMENT o Open: An existing file is opened by a process allowing the process to perform other operations on File Systems the file. A file system is an organization of data as files and o Close: An existing file is closed with respect to a directories, with a file-based interface and file process so that the process may no longer perform permissions to control access. This may also include any operation on the file. special file types for devices, socket, and metadata. o Read: A process reads all or a portion of the data in A file system interacts with applications. It can utilize the file. caching, buffering, and asynchronous I/O to avoid o Write: A process updates a file either by adding new subjecting applications to disk-level latency. data items in the files. The following are some of the desirable properties of Common File Attributes: a file system: ▪ File name – A human-readable label given to a file. Long-term existence: Files are stored on disk ▪ Identifier – A unique tag that distinguishes a file or on other secondary storage that must not within the file system. disappear when a user logs off. ▪ File type – Information used by systems to Shareable between processes: Files have recognize and handle different file formats. names and associated access permission that ▪ Location – A pointer indicating the device and permit controlled sharing. exact position of a file on that device. Good structure: A file can have an internal ▪ File size – The current size of a file measured in structure that is suitable for particular bytes, words, or blocks. applications. Files can be organized into a ▪ Protection – Access control mechanisms that hierarchical or more complex structure that specify who can read, write, or perform other reflects the relationship among files. operations on a file. ▪ Timestamp – Information typically comprising the Terms commonly encountered and used in file systems: creation time, last modification time, and last Field – The building block of data. Each field holds access time, used for security and monitoring a single value with a specific length and data purposes. type. The length can be fixed or variable, with variable-length fields often containing two or File Organization three subfields. Fields can store diverse data File organization pertains to the logical structure of like dates, surnames, or sensor readings. records as determined by the way in which they are Record – This is a collection of related fields that accessed. The physical organization of the file on can be treated as a unit by an application or a secondary storage depends on the blocking strategy program. The length of a record may also be and the file allocation strategy. fixed or variable. Example: Employee record with name, social security The following criteria are significant in choosing a file number, job classification, date of birth and gender. organization: File – This is a collection of similar records. A file is o Short access time treated as a single entity by users and o Ease of update applications and may be referenced by name. o Economical storage Fundamental operations can be performed on a o Simple maintenance file. Access control restrictions usually apply at o Reliability the file level. Database – This is a collection of related data. The The relative priority of these criteria greatly depends on relationships that exist among data elements the applications that utilize the file. Conflicts between are explicit and the possible applications widely these criteria may also arise. On the other hand, vary. This may contain all the information redundancy is a primary means of increasing the speed related to an organization or a project. of data access. The alternative structures that have been proposed and/or implemented in the industry Fundamental Operations: widely vary. o Create: A new file is defined and positioned within the file structure. Five Common File Organizations: o Delete: A file is removed from the file structure and 1. Pile – The simplest form of file organization. Data is subsequently be obliterated. collected in the order it is received. Files are unstructured. Each record must be examined until the desired record or file is found. Pile structures are used to collect data before processing, when data does not need to be organized, or when data is difficult to organize. Pile structures are not suitable for most applications. 2. Sequential file – The most common form of file organization. Records have a fixed format and are all the same length. Each record contains the same number of fixed-length fields in a specific order. A key field uniquely identifies each record. Sequential files are used in batch applications and are efficient for processing all data records. Sequential files are easy to store on tape or disk. 3. Indexed sequential file – An improvement on the sequential file structure. Records are organized by a key field, and two additional features are added: a file index for random access and an overflow file. The file index allows for quick access to the vicinity of a desired record, and the overflow file allows for records to be located by following a pointer from the previous record. Indexed sequential files reduce access time for individual records without affecting the sequential nature of the file. 4. Indexed file – A file organization with multiple indexes, one for each field that may be searched. Records are accessed only through their indexes, and there are no restrictions on their placement as long as a pointer in at least one index refers to that record. Two (2) types of indexes are usually used in this structure: * An exhaustive index that holds one (1) entry for every record in the main file; and * A partial index that holds entries to records where the field of interest exists. Indexed files are used in applications where up-to- date information is critical and data is rarely processed exhaustively, such as airline reservation systems and inventory control. 5. Direct/Hashed file – A file organization that takes advantage of the ability of disks to directly access any block of data with a known address. Direct files do not use sequential ordering. Direct files are used when very fast access is required, fixed-length records are used, and many records are accessed at once.