Compare between the (Single level Directory and, two level Directory) with Drawing and, Give one example for each one of them?

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter12: Secondary Storage Management
Section: Chapter Questions
Problem 6RQ
icon
Related questions
Question
Compare between the (Single level Directory
and, two level Directory) with Drawing and, Give
one example for each one of them?
Logical structure of a directory:
1) Single-Level Directory
The simplest directory structure is the single-level directory. All files are contained in
the same directory, which is easy to support and understand.
A single-level directory has significant limitations, however, when the number of files
increases or when the system has more than one user. Since all files are in the same
directory, they must have unique names. If two users call their data file test.txt, then
the unique-name rule is violated. For example, in one programming class, 23 students
called the program for their second assignment prog2.c; another 11 called it assign2.c.
Fortunately, most file systems support file names of up to 255 characters, so it is
relatively easy to select unique file names.
Even a single user on a single-level directory may find it difficult to remember the
names of all the files as the number of files increases. It is not uncommon for a user to
have hundreds of files on one computer system and an equal number of additional
files on another system. Keeping track of so many files is a daunting task.
directory caf
bo
a
test
data mail cont
hex records
at
A
C
C
files
2) Two-Level Directory
As we have seen, a single-level directory often leads to confusion of file names
among different users. The standard solution is to create a separate directory for each
user.
In the two-level directory structure, each user has his own user file directory (UFD)
The UFDs have similar structures, but each lists cely the files of a single user. When a
user job starts or a user logs in, the system's master file directory (MFD) is
searched. The MFD is indexed by user name or account number, and each entry
points to the UFD for that user.
When a user refers to a particular file, enly his own UFD is searched. Thus, different
users may have files with the same name, as long as all the file names within each
UFD are unique. To create a file for a user, the operating system searches only that
user's LFD to ascertain whether another file of that name exists. To delete a file, the
operating system confines its search to the local UFD; thus, it cannot accidentally
delete another user's file that has the same name.
directory ser2 user user 4
user fle
cat bo a test
adats a
directory cat
test x data
C C O O C O O Ó Ć C
The user directories themselves must be created and deleted as necessary.
A special system program is run with the appropriate user name and account
information. The program creates a new UFD and adds an entry for it to the MFD.
The execution of this program might be restricted to system administrators. Although
the two-level directory structure solves the name-collision problem, it still has
disadvantages. This structure effectively isolates one user from another. Isolation is an
advantage when the users are completely independent but is a disadvantage when the
users want to cooperate on some task and to access one another's files. Some systems
simply do not allow local user files to be accessed by other users.
If access is to be permitted, one user must have the ability to name a file in another
user's directory. To name a particular file uniquely in a two-level directory, we must
give both the user name and the file name. A two-level directory can be thought of as
a tree, or an inverted tree, of height 2. The root of the tree is the MFD. Its direct
descendants are the UFDs. The descendants of the UFDs are the files themselves. The
files are the leaves of the tree. Specifying a user name and a file name defines a path
in the tree from the root (the MFD) to a leaf (the specified file). Thus, a user name and
a file name define a path name. Every file in the system has a path name. To name a
file uniquely, a user must know the path name of the file desired.
a
Transcribed Image Text:Compare between the (Single level Directory and, two level Directory) with Drawing and, Give one example for each one of them? Logical structure of a directory: 1) Single-Level Directory The simplest directory structure is the single-level directory. All files are contained in the same directory, which is easy to support and understand. A single-level directory has significant limitations, however, when the number of files increases or when the system has more than one user. Since all files are in the same directory, they must have unique names. If two users call their data file test.txt, then the unique-name rule is violated. For example, in one programming class, 23 students called the program for their second assignment prog2.c; another 11 called it assign2.c. Fortunately, most file systems support file names of up to 255 characters, so it is relatively easy to select unique file names. Even a single user on a single-level directory may find it difficult to remember the names of all the files as the number of files increases. It is not uncommon for a user to have hundreds of files on one computer system and an equal number of additional files on another system. Keeping track of so many files is a daunting task. directory caf bo a test data mail cont hex records at A C C files 2) Two-Level Directory As we have seen, a single-level directory often leads to confusion of file names among different users. The standard solution is to create a separate directory for each user. In the two-level directory structure, each user has his own user file directory (UFD) The UFDs have similar structures, but each lists cely the files of a single user. When a user job starts or a user logs in, the system's master file directory (MFD) is searched. The MFD is indexed by user name or account number, and each entry points to the UFD for that user. When a user refers to a particular file, enly his own UFD is searched. Thus, different users may have files with the same name, as long as all the file names within each UFD are unique. To create a file for a user, the operating system searches only that user's LFD to ascertain whether another file of that name exists. To delete a file, the operating system confines its search to the local UFD; thus, it cannot accidentally delete another user's file that has the same name. directory ser2 user user 4 user fle cat bo a test adats a directory cat test x data C C O O C O O Ó Ć C The user directories themselves must be created and deleted as necessary. A special system program is run with the appropriate user name and account information. The program creates a new UFD and adds an entry for it to the MFD. The execution of this program might be restricted to system administrators. Although the two-level directory structure solves the name-collision problem, it still has disadvantages. This structure effectively isolates one user from another. Isolation is an advantage when the users are completely independent but is a disadvantage when the users want to cooperate on some task and to access one another's files. Some systems simply do not allow local user files to be accessed by other users. If access is to be permitted, one user must have the ability to name a file in another user's directory. To name a particular file uniquely in a two-level directory, we must give both the user name and the file name. A two-level directory can be thought of as a tree, or an inverted tree, of height 2. The root of the tree is the MFD. Its direct descendants are the UFDs. The descendants of the UFDs are the files themselves. The files are the leaves of the tree. Specifying a user name and a file name defines a path in the tree from the root (the MFD) to a leaf (the specified file). Thus, a user name and a file name define a path name. Every file in the system has a path name. To name a file uniquely, a user must know the path name of the file desired. a
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Data Recovery Approaches
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning