FileSystem Harish
FileSystem Harish
Implementation
Here is where your presentation begins
Table of Contents
• File Concept
• Operations
• Directory Structure
• Allocation Methods
01
File Concepts
Defenition of the file
• A File is a collection of records , where each record contains , same field where
each need to represent something(classes).
Time, date, and user identification – data for protection, security, and usage monitoring
02
File Operations
File Operations
• Create • Delete
Directory Structure
Defenition
The collection of files is a file directory. The directory contains information about the files,
including attributes, location, and ownership. Much of this information, especially that is
concerned with storage, is managed by the operating system. The directory is itself a file,
accessible by various file management routines.
File 1
File 3 Advantages : Simple to implement.
File 2
Disadvantages :
Naming problem: Users cannot have the same name for two files.
Grouping problem: Users cannot group files according to their needs.
Two level Directory
Advantages:
• Path name: Due to two levels there is a path
name for every file to locate that file.
• Now, we can have the same file name for
different users.
• Searching is efficient in this method.
Disadvantages :
Grouping problem: Users cannot group files according to their needs.
Tree level /Hierarchical Structure Directory
Advantages:
• This directory structure allows subdirectories inside a
directory.
• The searching is easier.
• File sorting of important and unimportant becomes
easier.
• This directory is more scalable than the other two
directory structures explained.
Disadvantages :
Sharing a file among different directory was difficult.
Acyclic Graph Structure Directory
Advantages:
• Sharing of files and directories is allowed between
multiple users.
• Searching becomes too easy.
• Flexibility is increased as file sharing and editing
access is there for multiple users.
Disadvantages :
• Because of the complex structure it has, it is difficult to implement this directory structure.
• The user must be very cautious to edit or even deletion of file as the file is accessed by multiple users.
• If we need to delete the file, then we need to delete all the references of the file inorder to delete it
permanently.
Implementation of Directory Structure
Linear list of file names with pointer to the data blocks
• Simple to program
• Time-consuming to execute
• Linear search time
• Could keep ordered alphabetically via linked list or use B+ tree
Hash Table – linear list with hash data structure
• Decreases directory search time
• Collisions – situations where two file names hash to the same location
• Only good if entries are fixed size, or use chained-overflow method
04
ALLOCATION
METHODS
Defenition
The allocation methods define how the files are stored in the disk blocks. There are three main
disk space or file allocation methods.
• Contiguous Allocation
• Linked Allocation
• Indexed Allocation
Advantages:
• Simple to implement.
• Test is suite for Sequential files.
Disadvantages :
• This method suffers from both internal and external fragmentation. This makes it
inefficient in terms of memory utilization.
• Increasing file size is difficult because it depends on the availability of contiguous
memory at a particular instance.
Linked Allocation
Advantages:
• This is very flexible in terms of file size. File size can be
increased easily since the system does not have to look for a
contiguous chunk of memory.
• This method does not suffer from external fragmentation. This
makes it relatively better in terms of memory utilization..
Disadvantages :
• large number of seeks are needed to access every block individually.
• It does not support random or direct access(sequential access ).
• Pointers required in the linked allocation incur some extra overhead.
• Access time is much required.
Indexed Allocation
Advantages:
• This supports direct access to the blocks.
• Provides fast access to the file blocks.
• It overcomes the problem of external
fragmentation.
• When file size increases we can able to add new
block to the file index.
Disadvantages :
• The pointer overhead for indexed allocation is greater than linked allocation.
• For very small files, say files that expand only 2-3 blocks, the indexed allocation
would keep one entire block (index block) for the pointers which is inefficient in
terms of memory utilization.
THANK YOU…