File Management in Operating System - CodeTextPro

File Management/File Management in Operating System:

File Management System
File Management


In this content, you will know all about an file management, file system in os, file management in operating system, features of operating system, file management system, types of operating system notes, characteristics of operating system, file operations in os and more.

File management is one of the basic and important features of an operating system. The operating system is used to manage files of the computer system. All the files with different extensions are managed by the operating system.
To learn about more features of the operating system: 

A file is a collection of specific information stored in the memory of the computer system. File management is defined as the process of manipulating files in the computer system, its management includes the process of creating, modifying and deleting the files

File: A file is a collection of similar records with a common name. A record is a collection of related fields that can be treated as a unit by some application program.


File operation: The main operations that a user can perform on a file.
1. Open: Make the file available to the user.
2. Close: Relinquish access to an opened file.
3. Read: Read the data from a given location in the file.
4. Write: Write the data into the file at a given location.
5. Erase: To erase the contents of the file.
6. Append: Add data at the end of the file.
7. Seek: Move to the specified location in the file from the current position.
8. Rename: Modify the name of the file to a new name.
9. Delete: Delete the file name from the system by removing its directory entry.

10. Truncate: To truncate a file, remove the file contents only, but the attributes areas it is.



File attributes: Following are some of the attributes of a file:

Name. It is the only information that is in a human-readable form. 

Identifier. The file is identified by a unique tag (number) within a file system.

Type. It is needed for systems that support different types of files.

Location. Pointer to file location on device.

Size. The current size of the file.

Protection. This controls and assigns the power of reading, writing, executing.

Time, date, and user identification. This is the data for protection, security, and usage monitoring.



File accessing techniques/methods:

Most important file accessing techniques are given below.
1. Sequential access.
2. Direct access.

3. Indexed sequential access.



Sequential access:

This method is the simplest of all methods. Information in the file is processed in order, one record after another. Magnetic tapes are supporting this type of file accessing. For example, consisting of 100 records, the current position of read/write head is 45th record, suppose we want to read the 75th record then it accesses sequentially from 45, 46, 47…….73,74,75.
So the read/write head traverse all records between 45 to 75. Consider the figure no 1 for better understanding.


Example: Sequential files are typically used in batch applications and payroll applications.


File Management Sequential access
 File Management Sequential access



Direct access:

Direct access is also called relative access. In this method, records can read/write randomly without any order. A direct access file allows arbitrary blocks to be read or written. For example, a disk consisting of 256 blocks, the current position of read/write head is at the 95th block. The block to be read or write is the 250th block. Then we can access the 250th block directly without any restrictions.
Example: The best example of direct access is a CD consisting of 10 songs, suppose at present we are listening to the song no: 3, suppose we want to listen the song no: 9 then we can shift from song no 3 to 9 without any restrictions.



Indexed sequential file:


  • This mechanism is built upon the base of sequential access.
  • An index is created for each file which contains pointers to various blocks.
  • An index is searched sequentially and its pointer is used to access the file directly.


Indexed sequential file
File Management System Indexed sequential file



Suppose a file consisting of 60,000 records, the master index divides the total records into 6 blocks, each block consisting of a pointer to secondary index. The secondary index divide the 10,000 records into 10 indexes. Each index consisting of a pointer to its original location. Each record in the index file consisting of two fields. A key field and pointer field. Suppose we want to access the 55,550th record then the file management system accesses the index that is 50,000 to 60,000, this block consisting of a pointer, this pointer points to the 6th index in the secondary index.

This index points to the original location of the record from 55,000 to 56,000. From this, it follows the sequential method. That’s why this method is said to be the indexed sequential file.
Example: airline reservation system.




Post a Comment

0 Comments