File Management in Operating System

Introduction

There can be a huge amount of files in our system. The operating system is responsible for managing the files. The operating system is used to manage computer files. The File Management in the operating system manages all files with various extensions.

Before we dive into file management in the operating system, let us first recap what a file is.

A file is a collection of specific information stored in a computer system’s memory. There are various types of files in our computer-like text files, images, audio/video files, etc. All these files have different extensions. The file management system is responsible for the efficient storage, retrieval, and manipulation of files.

What is File Management System in Operating System?

File management is one of the fundamental and crucial components of an operating system. The operating system manages computer system files. Operating systems control all files with various extensions.

File management is formally defined as manipulating files in a computer system, which includes creating, modifying, and deleting files. Therefore, one of the simple but crucial features offered by the operating system is file management. The operating system’s file management function entails software that handles or maintains files (binary, text, PDF, docs, audio, video, etc.) included in computer software.

The operating system’s file system has the ability to manage both single files and groups of files that are present in a computer system. All of the files on the computer system with different extensions(such as .exe, .pdf, .txt, .docx, etc.) are managed by the operating system’s file management.

Functions of File Management System in Operating System

The file management system is also known as the file system. It is responsible for file management in any system. The various functions involved in file management are as follows:

  • It is responsible for creating new files in the computer system and placing them in specific locations.
  • It is responsible for locating the existing files in the computer system.
  • It facilitates keeping the files in separate folders known as directories. These directories allow users to quickly search for files or organize files based on their types of uses.
  • It enables users to change the data of files or the name of files in directories.

Components of File Management in Operating System

The components of the file management system in the operating system are as follows:

  • File Attribute
  • File Operations
  • File Access Permissions
  • File Systems

File Attribute

It specifies file characteristics such as type, date of last modification, size, location on disk, and so on. File attributes assist the user in comprehending the value and location of files. It is used to describe all of the information about a specific file.

File Operations

It defines the actions that can be taken on a file, such as opening and closing it.

File Access Permissions

It specifies a file’s access permissions, such as read and writes. Without permission, a file cannot be accessed.

File Systems

It defines the logical method of storing files in a computer system. FAT and NTFS are two of the most commonly used file systems.

Operations on File Systems in Operating System

The various operation on files that can be performed by a user and is facilitated by the file management in the operating system are:

  • Creating a File
  • Reading a File
  • Writing a File
  • Deleting a File
  • Truncating a File

Creating a File

In order to create a new file, there should be ample space in the file system. The new file’s directory entry must then be created. This entry should include information about the file, such as its name, location, etc.

Reading a File

The system call must specify the file’s name and location to read from a file. A read pointer should be present at the location where the read should occur. The read pointer should be updated once the read process is completed.

Writing a File

To write to a file, the system call should specify the file’s name as well as the contents to be written. A write pointer should be present at the location where the write should occur. The write pointer should be updated after the write process is completed.

Deleting a File

In order to delete a file, it must be present in the directory. When the file is deleted, all the file space is deleted so it can be reused by other files.

Truncating a File

This removes the data from the file without erasing all of its attributes. Only the file length is reset to zero, and the contents of the file are erased. The remaining characteristics remain unchanged.

Source https://www.codingninjas.com/codestudio/library/file-management-in-operating-system

Leave a Reply