different file access method with example

In this topic, you will learn about, different file access methods with an example.

In file, the organization files can be accessed by using two methods:

  1. Sequential access.
  2. Random access.

Sequential access: In this file organization file access sequentially where sequence depends on memory block or file contents. It access file contents letter by letter where C & C++ programming language by default file access sequentially. It’s an example of a sequential file organization.

Random access: In DBMS file can be accessed randomly and allow to creation of a file on random memory locations and it also offers a facility to access file contents randomly. Random access file organizations use buffer memory for a transaction.

File access component:

File access method like sequential access and random access depends on the various component:-

  1. Memory: Due to memory organization file access sequentially or randomly where if file creates on a hard disk then access sequentially but store randomly with the help of master file organization but file store on primary memory create sequentially and access randomly like RAM.
  2. Network or Operating system: network like LAN access file randomly with the help of FTP(file transfer protocol). File access also depends on OS like Unix, Linux access sequentially but windows access randomly.

Comment below if you have queries related, different file access methods with an example.