Assignment on:
FILE CONCEPTS AND ACCESS METHODS
Submitted To:
MAAM FARHEEN
Submitted By:
MUHAMMAD AWAIS AJMAL
Roll No: 10
BSCS
6TH Semester
Session 2016-20
Department of Computer Science & IT
The Islamia University of Bahawalpur Pakistan
CONTENTS
What is a File?
Attributes of a File
File Structure and Types
File Access Methods
References
What is a File?
A file is a named collection of related information that is recorded on
secondary storage such as magnetic disks, magnetic tapes and optical disks.
OR
A file is a sequence of bits, bytes, lines or records whose meaning is defined by
the files creator and user.
ATTRIBUTES OF FILE
Name: only information kept in human-readable form.
Identifier: unique tag (number) identifies file within file system
Type: needed for systems that support different types
Location: pointer to file location on device
Size: current file size.
Protection: controls who can do reading, writing, executing.
Time, date, and user identification: data for protection, security, and
usage monitoring.
Information about files is kept in the directory structure, which is maintained
on the disk.
File Structure and Types
A File Structure should be according to a required format that the
operating system can understand.
A file has a certain defined structure according to its type.
Text File
Source File
Object File
Text file is a sequence of characters organized into lines.
Source file is a sequence of procedures and functions.
Object file is a sequence of bytes organized into blocks that are
understandable by the machine.
A file can have various types of structure :
Simple record structure :
Lines
Fixed length
Variable length
Complex Structures :
Formatted document
Relocatable load file
Who interprets this structure?
Operating system
Program
Access Methods
File access mechanism refers to the manner in which the records of a file
may be accessed.
There are several ways to access files :
Sequential access
Direct/Random access
Indexed sequential access
Sequential Access
A sequential access is that in which the records are accessed in some
sequence, i.e., the information in the file is processed in order, one record
after the other.
This access method is the most primitive one.
Example: Compilers usually access files in this fashion.
Direct/Random access
Random access file organization provides, accessing the records directly.
Each record has its own address on the file with by the help of which it can
be directly accessed for reading or writing.
The records need not be in any sequence within the file and they need not
be in adjacent locations on the storage medium.
Indexed Sequential Access
This mechanism is built up on base of sequential access.
An index is created for each file which contains pointers to various blocks.
Index is searched sequentially and its pointer is used to access the file
directly.
REFERENCES
1) https://www.studytonight.com/operating-system/file-system
2) https://www.geeksforgeeks.org/operating-system-file-access-
methods/
3) https://www.tutorialspoint.com/operating_system/os_file_system.
htm
4) https://www.youtube.com/watch?v=Zg-T2Zqq9YE