There are two types of files- sequential file and random access file.
In sequential file, data are kept sequential. As example if we want to access the forty fourth record, then first forty three records should be read sequentially to reach the forty fourth record. In the record access file, the data can be accessed and processed randomly i.e in this case the forty fourth record can be accessed directly. It takes less time than the sequential file.
Hence depending up on the method of accessing the data stored , there are two types of files.
- Sequential file
- Random access file
1.Sequential File: In this type of files data is kept in sequential order if we want to read the last record of the file, we need to read all records before that record so it takes more time.
Sequential Access to a data files means that the computer system reads or writes information to the file sequentially, starting from the beginning of the file and proceeding step by step.
2.Random access Files: In this type of files data can be read and modified randomly .If we want to read the last record we can read it directly. It takes less time when compared to sequential file.
Random Access to a file means that the computer system can read or write information anywhere in the data file. This type of operation is also called “Direct Access” because the computer system knows where the data is stored and hence goes “directly” and reads the data.
0 comments:
Post a Comment