Unit 3 File Management and File System CS 4001 (Same as CB/IT 4001)

Course Code: CS 4001 (Same as CB/IT 4001)

Course Title: Operating Systems
Author: Garima Kanwar (BTER Polytechnic Classes)
Blog: Rajasthan Polytechnic

(Course Code: CS 4001 / CB/IT 4001 – Operating Systems – 4th Semester Polytechnic CS)

📌 These notes are provided by Garima Kanwar on the blog Rajasthan Polytechnic. Stay connected for more study materials. For PDF versions, join our WhatsApp and Telegram groups.

📢 🔔 Important:
👉 Full PDF available in our WhatsApp Group | Telegram Channel
👉 Watch the full lecture on YouTube: BTER Polytechnic Classes

file management and file system, operating system notes

3.1 File Management

3.1.1 Concept of a File

A file is a collection of data stored on a storage device. It is the fundamental unit of storage in a computer system. Files can contain text, images, videos, or executable programs.

Types of Files

  • Text Files (.txt, .doc, .pdf) - Contain plain text or formatted text.

  • Binary Files (.exe, .bin) - Contain machine-readable data.

  • Multimedia Files (.jpg, .mp3, .mp4) - Store images, audio, and video.

  • System Files (.sys, .dll) - Used by the operating system.

File Attributes

Each file has the following attributes:

  • Name: Identifies the file.

  • Type: Determines the file format.

  • Size: Defines the file’s storage capacity.

  • Location: Specifies where the file is stored.

  • Protection: Controls file access permissions.

file attributes in os

File Operations

The operating system supports the following file operations: 

Create - Making a new file.
Open - Accessing an existing file.
Read - Retrieving data from a file.
Write - Adding or modifying data in a file.
Close - Ending file access.
Delete - Removing a file permanently.

(Diagram: File operations and attributes overview)

file operations in os


3.1.2 Access Methods

A file can be accessed in different ways depending on how the data is stored and retrieved.

1. Sequential Access

📌 Data is read in a linear manner, from start to end.
📌 Used in text files and log files.

2. Direct (Random) Access

📌 Allows access to any part of the file without reading previous data.
📌 Used in databases and executable files.

3. Indexed Access

📌 Uses an index to locate data blocks quickly.
📌 Similar to an index in a book.

(Diagram: Comparison of access methods)

file access methods in os


3.2 Directory Structure

A directory is a file system structure that stores files and other directories.

Types of Directory Structures

📂 Single-Level Directory - All files stored in one directory. ❌ Not suitable for large systems.
📂 Two-Level Directory - Separate directories for each user.
📂 Tree-Structured Directory - Hierarchical structure like folders in Windows.
📂 Acyclic Graph Directory - Supports shared files and links.
📂 General Graph Directory - Allows multiple parent directories, making it complex.

(Diagram: Different directory structures)

structures of directory in os


3.3 File System Structure and Implementation

3.3.1 Directory Implementation

A directory can be implemented using: 

Linear List: Stores files sequentially (Simple but slow).
Hash Table: Uses a hashing function for faster searching.

3.3.2 Free-Space Management

The operating system manages unused disk space using: 

📌 Bit Vector - Uses bits (0 for free, 1 for occupied).
📌 Linked List - Free blocks linked together.
📌 Grouping - Stores free blocks in groups.
📌 Counting - Stores starting address and number of blocks.

3.3.3 Efficiency and Performance

To enhance efficiency, OS uses: 

Disk Caching - Stores frequently used data.
Defragmentation - Reduces scattered file storage.
File Allocation Methods - Helps in space management.

(Diagram: File system implementation techniques)


3.4 Different Types of File Systems

File SystemDescriptionExample
FAT32Simple, used in USB drivesWindows
NTFSAdvanced security & compressionWindows
ext3/ext4Journaling systemLinux
HFS+Used in macOSMac
exFATUsed for large external drivesWindows, Mac

(Diagram: Comparison of different file systems)


🔗 Download PDF Notes & Join Discussions

📥 Download Full Notes PDF: Join WhatsApp Group Now
📢 Join Our Telegram Group for Doubts & Updates: Join Now

🔗 For more notes, visit our blog regularly!
📌 Join our WhatsApp & Telegram groups for PDFs.
📺 Watch full lectures on our YouTube channel: BTER Polytechnic Classes!

📢 🔔 Download PDF & Join Study Groups:
📥 WhatsApp Group: Join Now
📥 Telegram Channel: Join Now
📺 Watch Lecture on YouTube: BTER Polytechnic Classes
👉 📖 More Notes: Next Chapter – Disk Scheduling
📍 Stay connected for more study materials! 🚀

Stay connected with Rajasthan Polytechnic for more notes and updates!


Post a Comment

0 Comments