FILE ACCESS
- File organization is static.
- File access is dynamic.
Sequential Access
Terms
sequential access
- Access of data in order.
- Accessing data from a file whose records are organized on the basis of their successive physical positions.
Remarks
- Sequential access processes a file from its beginning.
- All operating systems support sequential access of files.
- Sequential access is the fastest way to read or write all of the records in a file.
- Sequential access is slow when reading a singlt random record, since all the preceeding records must be read.
Direct Access
Terms
direct access
- Access of data in arbitrary order, with variable access time.
- Accessing data from a file by record position with the file, without accessing intervening records.
relative record number
- An ordinal number indicating the position of a record within a file.
Remarks
- Direct access processes single records at a time
by position in the file.
- Mainfreme and midrange operating systems support direct access of files.
- The Windows, DOS, UNIX, and Linux operating systems do not natively support direct access of files.
- When using Windows, DOS, UNIX, and Linux operating systems applications must be programmed to use direct access.
- Direct access is slower than sequential when reading or writing all of the records in a file.
- Direct access is fast when reading a singlt random record, since the preceeding records are ignored.
- Direct access allows individual records to be read from different locations in the file without reading intervening records.
- When files are organized with fixed length records,
the location of a record in a file can be calculated
from its relative record number, and the file can be
accessed using the seek functions.
ByteOffset = (RRN - 1) × RecLen
- When files have variable length records supported
by an index,
the records can be accessed directly through the
index, with the use of the seek function.
- For direct access to be useful, the relative record number of the record of interest must be known.
- Direct access is often used to support keyed access.
Keyed Access
Terms
keyed access
- Accessing data from a file by an alphanumeric key associated with each record.
key
- A value which is contained within or associated with a record and which can be used to identify the record.
Remarks
- Keyed access processes single records at a time
by record key.
- Mainfreme and midrange operating systems support keyed access of files.
- The Windows, DOS, UNIX, and Linux operating systems do not natively support keyed access of files.
- When using Windows, DOS, UNIX, and Linux operating systems applications must be programmed to use keyed access.
- Keyed access will be covered in more detail in later chapters.
No comments:
Post a Comment