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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education