0% found this document useful (0 votes)
18 views7 pages

Group 2

The document discusses various file access methods used by operating systems to retrieve information from files stored in computer memory. It outlines three main methods: sequential access, which processes information in order; direct access, which allows rapid reading and writing of records in any order; and indexed access, which utilizes pointers to locate records efficiently. Each method has its own characteristics and use cases, with indexed access potentially requiring multiple levels of indexing for large files.

Uploaded by

smogarkar36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views7 pages

Group 2

The document discusses various file access methods used by operating systems to retrieve information from files stored in computer memory. It outlines three main methods: sequential access, which processes information in order; direct access, which allows rapid reading and writing of records in any order; and indexed access, which utilizes pointers to locate records efficiently. Each method has its own characteristics and use cases, with indexed access potentially requiring multiple levels of indexing for large files.

Uploaded by

smogarkar36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

File Access Methods :

 Computer memory store many files.


 Files store information.
 Application are used to access memory and read these files when required.
 There are several ways the operating system can access the information in the
files. These methods are also known as File Access Methods.
 Some systems provides only one access method for files.
 While others supports many access methods.
File Access Methods

Sequential access Direct access Indexed access


Method Method Method
Sequential Access method

 The simplest and most common access method is sequential access.


 Information in the file is processed in order, one record after the other.
 for example, editors and compilers usually access files in this fashion
 Reads and writes operations on a sequential file.
 A read operation-read next()-reads the next portion of the file and automatically
advances a file pointer, which tracks the I/O location.
 the write operation-write next()-appends to the end of the file and advances to
the end of the newly written material (the new end of file)
Sequential Access method

 file can be reset to the beginning.


 on some systems, a program may be able to skip forward or backward records
for some integer n-perhaps only for n = 1.
 Sequential access, is based on a tape model of a file and works as well on
sequential-access devices.
Direct Access method

 Another method is direct access (or relative access).


 A file is made up of fixed-length logical records that allow programs to read
and write records rapidly in no particular order.
 The direct-access method is based on a disk model of a file, since disks allow
random access to any file block.
 For direct access, the file is viewed as a numbered sequence of blocks or
records.
 we may read block 14, then read block 53) and then write block 7.
 There are no restrictions on the order of reading or writing for a direct- access
file.
Indexed Access method

 In indexed access file contains a collection of blocks and pointers are assigned
various blocks.
 To find a record in the file, we first search the index and then use the pointer to
access the file directly and to find the desired record.
Indexed Access method

 With large files, the index file itself may become too large to be kept in
memory.

 One solution is to create an index for the index file.

 The primary index file contains pointers to secondary index files, which point
to the actual data items.

You might also like