Directory is implemented by using linear list and hash table. Linear list is simple method of directory implementation.
Directory Implementation
• Directory is implemented by using linear list and hash table.
Linear list
• Linear list is simple method of
directory implementation. It uses file names with bead pointers to data block.
It is time consuming because of searching overheads.
• To
create a new file, file name is searched in the directory to avoid the file
name duplication. Then it adds new entry at the end of the directory. To delete
a file, again file name is searched in the directory. Space is released after
deleting a file. Directory entry is also removed. Unused space is marked as
free entry. Last entry of directory is copied into the free space list.
•
For deleting a file, some OS uses linked list. Linked list decreases time
required.
• Searching
the directory entry is the major disadvantage. It is slow process. Because of
this reason, many operating system uses software cache memory. It stores the
most recently used directory information.
Hash
table
• Hash table is one more data structure
used for directory implementation. Hash table takes a value computed from the
file name and returns a pointer to the file name in the liner list.
• Hash table reduces the searching time.
It uses fixed size block.
Introduction to Operating Systems: Unit IV(b): File System : Tag: : File System - Introduction to Operating Systems - Directory Implementation
Introduction to Operating Systems
CS3451 4th Semester CSE Dept | 2021 Regulation | 4th Semester CSE Dept 2021 Regulation