Computers store data on disks using files, which are structured
in specific ways in order to allow for faster access, higher
reliability, and to make better use out of the drive's available
space.
The specific way in which files are stored on a disk is called a
file system, and enables files to have names and attributes.
It also allows them to be stored in a hierarchy of directories or
folders arranged in a directory tree.
Linear list of file names with pointer to the data blocks.
Simple to program
Time consuming- linear search for file names required,
whenever a new file is created or an existing file is deleted.
A sorted list allows binary search, thereby reducing time
consumption, but this complicates creation and deletion processes.
To Overcome this problem, many operating systems implement a
software cache to store the most recently used directory
information from the disk.
Hash table - another data structure.
linear list stores the directory entries, but a hash data structure is
also used.
the hash table takes a value computed from the file name and
returns a pointer to the file name in the linear list.
greatly decreases directory search time.
insertion and deletion are easy.
Collisions – situation in which two file names hash to the same
location.
Chained overflow hash table –
• each hash entry is a linked list instead of an individual value
• collisions can be avoided by adding a new entry to the linked list.
An allocation method refers to how disk blocks are
allocated for files.
The main problem is to allocate space to files so that
disk space is utilized effectively and files can be
accessed quickly.
Three types :
1. Contiguous allocation
2. Linked allocation
3. Indexed allocation
Each file occupy a set of contiguous blocks on that disk.
Assuming only one job is accessing the disk, accessing
block ‘k+1’ after block ‘k’ normally requires no head
movement. Thus the number of disk seeks required for
accessing contiguously allocated files is minimal.
Contiguous allocation of a file is defined by the disk
address and length of the first block
The directory entry for each file indicates the address of
the starting block and the length of the area allocated for the
file.
Easy Accessing – only starting location (block #) and length
(number for blocks) are required.
Files cannot grow.