List of directory structures:
Single level directory structure
Two level directory structure
Single level directory structure: It is the simplest form of directory structure, having one directory containing all the files, and each file must have a unique name. Software design is simple. The advantages of this scheme are its simplicity and the ability to locate files quickly.
Since all files are in the same directory, they must have unique names. If there are two users who call their data file "test", then the unique-name rule is violated. Even with a single-user, as the number of files increases, it becomes difficult to remember the names of all the files in order to create files with unique name.
Two level directory structure: In this structure, each user has its own user file directory (UFD). The UFD lists only files of a single user. System contains a master file directory (MFD) which is indexed by user name or account number.
Each entry in MFD points to the UFD for that user.
When a user refers to a particular file, only his own UFD is searched. Different users can have files with the same name, as long as all the file names within each UFD are unique. When we create a file for a user, operating system searches only that user’s UFD same name file already present in the directory.
For deleting a file again operating system checks the file name in the user’s UFD only.
0 Comments