Focuses on file management concepts and structures.
Sections covered: B-Trees and file directory management.
Assumes prior knowledge of Tree Data Structures.
Essential terms:
Nodes, Branches, Parent nodes, Children nodes, Sibling nodes, Root node, Leaf nodes, Inner nodes.
Concepts of Breadth and Depth.
Importance of trees being cycle-free.
Reference: Section 12.5 of the 1st-Semester COS151 textbook for foundational understanding.
Definition:
A balanced tree data structure with all branches of equal length.
Characteristics:
Standard structure for organizing indices.
Widely employed in Operating System (OS) file systems for indexing.
Facilitates efficient operations: searching, adding, and deleting items.
Advice to consult Study-Year 2: Algorithms and Data Structures for deeper insights on B-Trees.
Node Structure:
A node can contain at most 2d - 1 keys and 2d children (or pointers).
Except for the root, every node must have at least d - 1 keys and d pointers.
Internal nodes (excluding root) at least half full, must have a minimum of d children.
The root node must have a minimum of 1 key and 2 children.
All leaf nodes are at the same level and do not contain any information.
Nonleaf node with k pointers contains k - 1 keys.
Structure of a B-Tree Node:
Displays keys in sorted order: Key1 < Key3 < ... < Keyk-1.
Subtrees rooted at each key to maintain order and branching.
Inserting Nodes Dynamics:
Different types of insertions:
Simple insertion within a node (e.g., Key = 90).
Node splitting when necessary, promoting a key to the root (e.g., Key = 45 and Key = 84).
Demonstrates dynamic changes in node structure as keys are added.
Example: B-tree of minimum degree d = 3 with varying keys listed.
Basic Information Components:
File Name: Unique identifier for the file within a directory.
File Type: Categories such as text, binary, etc.
File Organization: Specifies structure based on system capabilities.
Address Information:
Volume: Indicates storage device.
Starting Address: Physical location in secondary storage.
Size Used: Current file size.
Size Allocated: Maximum file size duration.
Access Control Information:
Owner: User with control, can modify access.
Access Information: Includes names/passwords for access rights.
Permitted Actions: Control over read, write, execute permissions.
Usage Information:
Tracks file creation, modification, and access dates and activities.
Types of operations that can be performed on a directory:
Search
Create files
Delete files
List directory contents
Update directory
Structure Overview:
Each user has a dedicated directory.
Master directory listing all user directories:
Contains addresses and access control info for each user.
User directories display files owned by that user.
Unique names enforced only within individual user’s collection.
Visual representation:
Describes how each directory can have its structure with master and user directories.
Illustrates hierarchical data organization.
Depicts a tree structure of directories and subdirectories:
Example of how a file's pathname is structured (e.g., /User_B/Word/Unit_A/ABC).
Shows nested relationship among directories.
Two main issues for file sharing:
Access Rights: Specification of permissions for users.
Management of Simultaneous Access: Coordinating multiple users interacting with files.
Different levels of access rights include:
None: No access to directory.
Knowledge: Awareness of file existence; can request access.
Execution: Can run programs, cannot copy.
Reading: Full reading capability of files.
Appending: Can add data but not modify existing content.
Updating: Can modify and delete data.
Changing Protection: Can alter access rights for others.
Deletion: Can remove the file from the system.
Owner: Completes full control and rights.
Specific Users: Designated users with defined rights.
User Groups: Defined groups sharing access rights.
All Users: Public access to files.
Consideration: Potential risks if ownership rights are misallocated to other users.