Chapter 8
Learning Objectives
After completing this chapter, you should be able to:
Describe how files are managed
Explain how files are named and the role of extensions
Differentiate between variable-length record storage and fixed-length records
Compare various file storage techniques
Understand comparisons of sequential and direct file access
Discuss access control techniques and their comparisons
Recognize the importance of data compression in file storage
Introduction to File Management
The efficiency of file managers is influenced by:
Organization of the system's files
Method of storing files
Structure of each file's records
Protection of user access to files
The File Manager
Known as the File Management System:
Responsible for file access tasks:
Creating, deleting, modifying files
Controlling access to files
Managing resources used by files
Responsibilities of the File Manager
Four Main Tasks
File Storage Tracking:
Keep track of where each file is stored.
Policy Implementation:
Determine where and how files are stored.
Efficient use of available storage space.
Communicate file availability.
File Allocation:
Allocate space for files if user access is allowed.
File Deallocation:
Return files to storage when no longer in use.
Access Control Policies
File Storage Location Policy:
Defines how systems and users can access files.
Access Flexibility:
Share files, provide access to multiple users, allow public directory browsing.
Security Measures
Prevent system malfunctions via:
Security checks (e.g., account numbers, passwords).
File Allocation:
Activate storage devices, load files into memory, update records.
Definitions of Key Terms
Records and Files
Field: Group of related bytes identified by user attributes (name, type, size).
Record: Group of related fields.
File: Group of related records used by specific application programs (e.g., flat files have no connections to other files).
Database
Group of related files interconnected at various levels, allowing flexible access.
Directories (Folders)
Listings of filenames and their attributes.
Interacting with the File Manager
Common User Commands
Typical commands include:
OPEN, DELETE, RENAME, COPY.
Device Independence
Users do not need to know about the physical storage organization (e.g., cylinders, sectors) as it’s managed by the device driver.
Logical Commands in File Access
When accessing files, commands are processed into lower-level signals to read/write data effectively.
Typical Volume Configuration
Storage Units
Each secondary storage unit can be removable or non-removable.
Types of configurations:
Multi-file Volume: Contains multiple files.
Multi-volume Files: Large files spanning multiple volumes.
Volume Descriptor
Contains essential information about the storage unit, stored at the beginning of each volume.
Master File Directory (MFD)
Lists all files in the volume with characteristics, including file names and subdirectories (if supported).
The remainder of the volume is used for file storage.
File-Naming Conventions
Filename Structure
Relative filename and extension constitute filename components.
Complete filename includes all path information (absolute filename).
Case Sensitivity
Varies by operating system (e.g., case-sensitive in Linux, not in Windows).
Extensions
Identify file types and contents, typically two to four characters long.
Operating System Examples
Windows: C:\IMFST\FLYNN\INVENTORY_COST.DOC.
UNIX/Linux: /usr/imfst/flynn/inventory_cost.doc.
File Organization
Records within files determine how data is accessed and modified:
Commands to access records involve read/write operations and requesting data from structured records.
Record Formats
Fixed vs. Variable Length
Fixed-length Records: Consistent size, no truncation, easy access.
Variable-length Records: Size varies, can lead to truncation if too large.
Physical File Organization
Factors Influencing Organization
Decided by:
Record arrangement
Medium characteristics (magnetic disks).
Types of File Organizations
Sequential: Easiest to implement, stored and retrieved serially.
Direct: Requires direct access storage, allows quick retrieval but can face addressing challenges.
Indexed Sequential: Combines benefits of both methods, avoiding collisions with indexed access.
Physical Storage Allocation
Contiguous Storage: Records stored one after another, easy direct access but hard expansion (e.g., file fragmentation).
Noncontiguous Storage: Eliminates fragmentation, linked extents for organization but lacks direct access.
Indexed Storage
Index blocks link pointers for each extent in a file, allowing direct access but may require multiple index levels for larger files.
Access Methods
Most flexible with indexed sequential files; least flexible with sequential files.
Adjustments necessary for record lengths during sequential access.
Access Control Verification
File Sharing Policies
Advantages in efficiency but necessity for integrity protection remains vital.
Access Control Methods
Access Control Matrix vs. Access Control Lists
Matrix: Easy but inefficient as files/users increase.
Lists: More efficient but require organization into categories (e.g., SYSTEM, OWNER, GROUP, WORLD).
Data Compression
Types
Lossless: Retains all data (text, arithmetic files).
Lossy: Removes data while maintaining quality (images, sounds).
Compression Techniques
Text compression involves replacing repeated characters with codes or symbols.
Image compression often uses algorithms suited to the file type.
Conclusion
The File Manager is crucial in controlling files, managing user commands, access control, integrity, security, and various file organizations and storage techniques including compression methods.
Learning Objectives
After completing this chapter, you should be able to:
Describe how files are managed in a computing environment.
Explain how files are named, detailing the significance of file extensions.
Differentiate between variable-length record storage and fixed-length records, understanding their use cases.
Compare various file storage techniques, including their advantages and disadvantages.
Understand comparisons of sequential and direct file access and their implications on performance.
Discuss access control techniques and their effectiveness in safeguarding data.
Recognize the importance of data compression in file storage and its impact on efficiency.
Introduction to File Management
The efficiency of file managers is influenced by:
Organization of the system's files: A structured approach enhances accessibility.
Method of storing files: Determines retrieval speed and storage efficiency.
Structure of each file's records: Impacts how data is accessed and managed.
Protection of user access to files: Ensures data security and user privilege management.
The File Manager
Known as the File Management System, the file manager is a critical component of an operating system responsible for file access tasks. Key responsibilities include:
Creating, deleting, and modifying files: Essential for file lifecycle management.
Controlling access to files: Enforces permissions and user rights.
Managing resources used by files: Oversees allocation and deallocation of storage space.
Responsibilities of the File Manager
Four Main Tasks
File Storage Tracking: Continuously monitors where each file is physically located on the storage medium to ensure efficient retrieval.
Policy Implementation: Enforces how and where files are stored, ensuring best practices in data management and efficient use of available storage space.
File Allocation: Dedicates space for files based on user requests, optimizing the use of physical storage.
File Deallocation: Responsible for returning files to a free state when they are no longer in use, thus allowing for efficient storage reuse.
Access Control Policies
File Storage Location Policy
Defines how systems and users can access files, ensuring that there are guidelines for security and organization.
Access Flexibility: Facilitates file sharing, provides multi-user access, and allows public directory browsing while maintaining data integrity.
Security Measures
Prevent system malfunctions through various security checks, such as validating account numbers or passwords.
File Allocation
Activate storage devices: Involves not only loading files into memory but also updating records to reflect current usage status.
Definitions of Key Terms
Records and Files:
Field: Group of related bytes identified by user-defined attributes (name, type, size).
Record: Composed of related fields that together represent a single entry.
File: A collection of related records used by applications, with flat files having no interconnections with other files.
Database: A structured collection of related files that interconnect at varying levels, facilitating flexible data access.
Directories (Folders): Hierarchical listings that keep track of filenames and their respective attributes.
Interacting with the File Manager
Common User Commands
Users rely on a limited set of commands to interact with the file manager. Typical commands include:
OPEN: Access a file for reading or writing.
DELETE: Remove a file from the system.
RENAME: Change the name of a file for easier identification.
COPY: Create a duplicate of a file with a new name or location.
Device Independence
Users are abstracted from the physical storage organization (e.g., cylinders, sectors) as this complexity is managed by the device driver, allowing for user-friendly interactions with the file system.
Logical Commands in File Access
When accessing files, logical commands are converted into lower-level signals and commands to efficiently read/write data.
Typical Volume Configuration
Storage Units
Each secondary storage unit can be classified as either removable or non-removable. Various configurations include:
Multi-file Volume: Contains multiple files structured for related access.
Multi-volume Files: Large files that span across multiple storage volumes, requiring careful management.
Volume Descriptor
Contains essential metadata about the storage unit, which is crucial for file management and organization, stored at the beginning of each volume.
Master File Directory (MFD)
A comprehensive directory that lists all files in the volume along with their attributes, such as file names and any subdirectories present, serving as the main navigation aid within the file structure.
File-Naming Conventions
Filename Structure
A filename consists of two crucial components:
Relative filename and extension, which collectively form the complete identifier of a file.
Complete filename includes all path information (known as the absolute filename), which helps locate files within directory structures.
Case Sensitivity
The treatment of case sensitivity varies across operating systems:
For instance, Linux is case-sensitive, meaning
file.txtandFile.txtare considered different files, whereas Windows is generally not case-sensitive.
Extensions
File extensions serve as identifiers for file types and contents, typically comprising two to four characters that inform users and systems about the file's nature (e.g., .doc for documents, .jpg for images).
Operating System Examples
Windows: Example path format –
C:\IMFST\FLYNN\INVENTORY_COST.DOC.UNIX/Linux: Example path format –
/usr/imfst/flynn/inventory_cost.doc.
File Organization
The arrangement of records within files determines the methods through which data can be accessed and modified:
Commands to access records typically engage in read/write operations, which entail requesting data from structured records.
Record Formats
Fixed vs. Variable Length
Fixed-length Records: Have a consistent size which simplifies access but may result in wasted space if data does not fill the entire record size.
Variable-length Records: Can vary in size, adapting to the actual data stored, although they can lead to complications such as truncation if the data exceeds prescribed sizes.
Physical File Organization
Factors Influencing Organization
Physical file organization decisions are influenced by:
Record arrangement: How data is formatted and organized within storage.
Medium characteristics: Impacted by the type of storage medium (e.g., magnetic disks).
Types of File Organizations
Sequential: The simplest to implement, where data is stored and retrieved in a linear fashion, ideal for batch processing.
Direct: Allows direct access storage enabling quick retrieval, though it may involve challenges in addressing due to fragmentation.
Indexed Sequential: Merges the advantages of both methods, organizing data for efficient access while preventing collisions during indexed access.
Physical Storage Allocation
Contiguous Storage
Files are arranged one after another in a continuous block, which facilitates direct access but complicates expansion and contributes to issues like file fragmentation.
Noncontiguous Storage
This method removes fragmentation issues by utilizing linked extents to organize the storage space; however, it sacrifices the speed of direct access.
Indexed Storage
In this approach, index blocks contain pointers for each extent in a file, allowing for direct access. Larger files may necessitate multiple index levels, adding complexity.
Access Methods
The most flexible access methods are found with indexed sequential files, which allow for efficient data handling, while sequential access is the least flexible and may necessitate adjustments for varying record lengths.
Access Control Verification
File Sharing Policies
While file sharing can enhance operational efficiency, the necessity for integrity protection remains of utmost importance to prevent data breaches.
Access Control Methods
Access Control Matrix: Provides a straightforward but potentially inefficient approach as the number of files and users increases.
Access Control Lists: More efficient, requiring organization into categories such as SYSTEM, OWNER, GROUP, and WORLD to streamline permissions.
Data Compression
Types
Lossless Compression: Retains all original data, suitable for text and arithmetic files.
Lossy Compression: Eliminates some data while maintaining acceptable quality, often used for image and sound files.
Compression Techniques
Text compression: Employs techniques that replace repeated characters with shorter codes or symbols, optimizing storage.
Image compression: Utilizes specific algorithms tailored to the characteristics of the file type, reducing size without significantly degrading quality.
Conclusion
The File Manager plays a crucial role in not only controlling files and managing user commands but also in implementing effective access control, ensuring data integrity, providing security, and overseeing various file organizations alongside storage techniques, including essential compression methods that enhance overall efficiency in file management.