os

Short note on File Accessing method in OS

Short note on File Accessing method in OS

os

Short note on File Accessing method in OS

 

When a file is used, information is read and accessed into computer memory and there are several ways to access this information of the file. Some systems provide only one access method for files. Other systems, such as those of IBM, support many access methods, and choosing the right one for a particular application is a major design problem.

There are three ways to access a file into a computer system: Sequential-Access, Direct Access, Index sequential Method.

1. Sequential Access –

It is the simplest access method. Information in the file is processed in order, one record after the other. This mode of access is by far the most common; for example, editor and compiler usually access the file in this fashion.

Read and write make up the bulk of the operation on a file. A read operation -read next-read the next position of the file and automatically advance a file pointer, which keeps track I/O location. Similarly, for the -write next- append to the end of the file and advance to the newly written material.

Key points :

●  Data is accessed one record right after another record in an order.

●  When we use read command, it move ahead pointer by one

●  When we use write command, it will allocate memory and move the pointer to the end of the file

●  Such a method is reasonable for tape.

 

Advantages of Sequential Access Method :

● It is simple to implement this file access mechanism.

● It uses lexicographic order to quickly access the next entry.

Disadvantages of Sequential Access Method :

●  If the file record that needs to be accessed next is not present next to the current record, this type of file access method is slow.

●  Moving a sizeable chunk of the file may be necessary to insert a new record.

 

2. Direct Access –

 

Another method is direct access method also known as relative access method. A fixed-length logical record that allows the program to read and write record rapidly. in no particular order. The direct access is based on the disk model of a file since disk allows random access to any file block. For direct access, the file is viewed as a numbered sequence of block or record. Thus, we may read block 14 then block 59, and then we can write block 17. There is no restriction on the order of reading and writing for a direct access file.

A block number provided by the user to the operating system is normally a relative block number, the first relative block of the file is 0 and then 1 and so on.

Advantages of Direct Access Method :

●  The files can be immediately accessed decreasing the average access time.

●  In the direct access method, in order to access a block, there is no need of traversing all the blocks present before it.

 

3.Index sequential method –

 

It is the other method of accessing a file that is built on the top of the sequential access method. These methods construct an index for the file. The index, like an index in the back of a book, contains the pointer to the various blocks. To find a record in the file, we first search the index, and then by the help of pointer we access the file directly.

Key points:

●  It is built on top of Sequential access.

●  It control the pointer by using index.

 


 

Topics Covered :

  • what is operating system and its types
  • operating system in computer
  • operating system responsibilities
  • operating system definition
  • operating system kya hai
  • operating system in hindi
  • operating system pdf
  • operating system ppt
  • operating system full course
  • types of operating system
  • functions of operating system
  • operating system in detail
  • what is operating system full information
  • use of operating system
  • operating system
  • why operating system
  • what is operating system

 

 


 

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

 

🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
👉🏻 Instagram : https://www.instagram.com/thetechdcode/
👉🏻 Facebook Page : https://www.facebook.com/thetechdcode
👉🏻 Twitter : https://twitter.com/thetechdcode
👉🏻 Telegram Channel : https://t.me/thetechdcode
👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode
👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :

👉🏻 Instagram : https://www.instagram.com/virtualshivamin/
👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/
👉🏻 Twitter : https://twitter.com/virtualshivamin/
👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin 

 

Leave a Reply

Your email address will not be published. Required fields are marked *