3.2. File System Interface-Directory Structure and
3.2. File System Interface-Directory Structure and
Course Outcome:
Upon completion of the session, students shall have ability to
CO5 Apply concepts of file system interface,implementation, and disk management [AP]
to optimize storage utilization and random access to files.
Directory Structure
Directory Organization
Single-Level Directory
• A single directory for all users all the files are in the same directory,
they must have a unique name
• Naming problem
• Grouping problem
Single-Level Directory
Advantages
• If the sizes of the files are very small then the searching becomes faster.
• File creation, searching, deletion is very simple since only one directory.
Disadvantages
• The directory may be very big therefore searching for a file take so much time.
Two-Level Directory
In the two-level directory structure, each user has their own user files directory (UFD).
The UFDs have similar structures, but each lists only the files of a single user.
System’s master file directory (MFD) is searched whenever a new user id is correct.
Two-Level Directory
Tree-Structured Directories
• Tree directory structure is most commonly used in our personal computers.
• Directory structure resembles a real tree upside down, where the root directory is at the
peak.
• This root contains all the directories for each user.
• The users can create subdirectories and even store files in their directory.
• A user do not have access to the root directory data and cannot modify it. And, even in this
directory the user do not have access to other user’s directories.
Acyclic-Graph Directories
• The tree structured doesn't allow the same file to exist in multiple directories.
• We can provide sharing by making the directory an acyclic graph.
• In this system, two or more directory entry can point to the same file or sub directory.
• That file or sub directory is shared between the two directory entries.
• These kinds of directory graphs can be made using links or aliases.
• We can have multiple paths for a same file.
• Links can either be symbolic (logical) or hard link (physical).
Acyclic-Graph Directories
If a file gets deleted in acyclic graph structured directory
system, then
1. In the case of soft link, the file just gets deleted and we
are left with a dangling pointer.
2. In the case of hard link, the actual file will be deleted
only if all the references to it gets deleted.
Current Directory
Protection
chgrp G game
Try……
• Find the correct matching answer
Files in the same directory Tree Structure Directory
Each user has their own user files Single Level Directory
directory (UFD)
Answer
Each user has their own user files Two level Directory
directory (UFD)
Next Session…
3.3 File system mounting - File Sharing and Protection;