ch18
CHAPTER 18: FILE MANAGEMENT
Overview
Introduction to File Management
Logical and Physical View of Files
Role of the File Management System
Logical File Access Methods
Physical File Storage
File Systems, Volumes, Disks, Partitions, and Storage Pools
Directory Structure
Network File Access
File Protection
Journaling File Systems
Introduction to Files
Definition: A collection of related data.
Block: The basic unit of file storage, typically between 256 and 4096 bytes; generally requires a minimum of one block for storage.
Cluster: Grouping of one or more blocks corresponding to one or more sectors on a disk, allowing efficient access.
File Extension: Suffix at the end of a file name that identifies the file type, which helps the operating system determine how to handle the file.
File Association: Specifies the program that utilizes the file type based on its extension, linking it to appropriate applications.
Terminology
Logical View: User's perspective of file contents and attributes, which may differ from the actual storage method.
Physical View: The actual method used to store files within the system, which may include various storage strategies.
Access Methods:
Sequential Access: Requires retrieval of data from the beginning of the file, useful for reading through entire datasets.
Random/Relative Access: Allows data retrieval at any point in the file, enabling quick access to specific information.
Storage Types:
Contiguous: Blocks of data are stored together in sequence, enhancing reading speed.
Noncontiguous: Blocks are scattered across the device, which can slow access times but allows more flexible storage.
File Management System
Purpose: Facilitates a logical view of storage and hides the complexities of physical implementations.
Commands: Translates user commands into appropriate device actions, streamlining user interactions with the file system.
File Manipulation: Handles operations within files and directory structures, allowing for the creation, deletion, and modification of files.
Security: Ensures the integrity and protection of files through access controls and other security measures.
File Operations:
Whole File Operations
Copy: Duplicates the file in a specified location.
Move: Transfers the file to a new location.
List: Displays the contents of directories or file attributes.
Print: Sends the file to a printer for a hard copy.
Load and Execute Programs: Runs executable files, typically in application environments.
Append Data: Adds information to the end of an existing file.
Compile Files: Converts source code into executable programs, enabling usage.
Within a File Operations
Open & Close file: Methods to access and release file resources.
Read/Write bytes to/from files: Allows the transfer of data between files and the computing environment.
Move file pointer within the file: Adjusts the location for the next read/write operation, crucial for data management.
Record Storage Operations
Retrieve Records: Allows access to specific data entries for processing.
Store Records: Saves data entries into the file for future retrieval.
Add/Delete Records: Manages the contents of files dynamically.
Modify Records: Makes changes to existing entries as required.
File Directory Operations
Create new file: Establishes a new file entry within the file system.
Move/Rename/Delete files: Modifies the organizational structure of files within the directory.
Append one file to another: Combines file contents into a single file entity for data management.
File Management and I/O Functions
Separation Benefits:
Allows for independent changes to I/O devices, enhancing system flexibility.
Simplifies data redirection for various application needs.
File Access Methods
Sequential Access: Data is read in order, making it common for most file types.
Random Access: Uses fixed-length records, with locations calculated typically through hashing.
Indexed Access: Employs key indexes for quick record access, seen in systems like Indexed Sequential Access Method (ISAM).
Physical File Storage
Categorized as: Contiguous, Non-contiguous, Linked, and Indexed.
File System Examples: DOS/Windows FAT, UNIX i-nodes, Windows NTFS provide various methods of organizing and accessing files effectively.
Contiguous Storage Allocation
Description: Assigns all blocks to a file in sequence.
Challenges: Must predict and allocate space for potential file growth while managing fragmentation that impacts performance.
Linked Allocation
Description: Allows noncontiguous storage with each block linking to the next, optimizing space use.
Advantages: No fragmentation occurs, and it simplifies file growth.
Disadvantages: Can result in slower random access and difficulties in recovery of defective blocks.
File Allocation Table (FAT)
Structure: A linked allocation structure with links stored in a table.
Disadvantages: High space requirements which may lead to potential integrity issues if corrupted.
Indexed Allocation
Description: All links stored in a single index block for quick access.
Advantages: Avoids fragmentation and facilitates efficient random access.
Disadvantages: Slower access times due to index referencing, and recovery from corruption can be complex.
UNIX I-NODES
Structure: Contains file attributes and pointers to data blocks in an indexed setup.
Benefits: Rapid access for small files, efficiently handles large file sizes through well-structured pointers.
Windows NTFS
Features: Supports dynamic volume sizes and utilizes a Master File Table (MFT) for management.
MFT Attributes: Includes file attributes, metadata, and provisions for system file management.
Microsoft Resilient File System (REFS)
Characteristics: Enhanced file management features, including advanced metadata handling and improved data integrity measures.
Free Space Management
Methods:
Bitmap: Uses one bit per block to indicate usage and availability.
Linked List: A pointer tracks first free block and subsequent free blocks for space allocation.
Other Secondary Storage Allocation
Tape Allocation: Contiguous allocation when feasible; for files that grow, rewrites may be required.
Optical Drives: Utilizes mechanisms akin to hard disk storage for organization and access.
Directory Structure
Purpose: Organizes files for efficient access, abstracting physical device details for user interface.
Components: Encompasses partitions and volumes with defined mounting requirements for logical access.
Tree-Structure Directory
Description: Hierarchical organization of files, stemming from a root directory, illustrating relationships among files.
Pathnames:
Absolute Path: Full path from the root (e.g., C:\FINANCE\QUICKEN\Q.EXE).
Relative Path: Describes the path from the current directory context.
Acyclic Directory Structures
Functionality: Allows for linked directories in a non-cyclic organization.
Challenges: May lead to cycles or dangling links if not managed properly.
Network File Access
Protocols: Includes FTP and NFS, allowing remote file operations across networks.
Configuration: Typically requires user processes to interact with remote file managers guided by network protocols for effective access.
File Protection
Methods:
Logins and Passwords: Basic authentication to protect file access.
Access Control List (ACL): Details user permissions for specific files, enhancing security hierarchies.
UNIX/Linux Owner/Group/Everyone Protection: Classifies permissions at three levels to protect file integrity based on user groupings.
Journaling File Systems
Functionality: Maintains a log of all write transactions to uphold data integrity during operable conditions.
Examples: NTFS, Linux ext3/ext4, and IBM JFS represent systems employing journaling techniques for reliability.