In Two-level directory structure, the users create directory directly inside the root directory. Even if the file with the same name is created the old file will get destroyed first and replaced by the new file having the same name. There is one drawback of Single-level directory structure, a user cannot use the same file name used by another user in the system. All the files created by the several users are present in the root directory only.Īs you can see in the diagram below all the file F1, F2, F3, F4 created by the different users are present at the root directory. The users are not allowed to create subdirectories under the root directory. Single level directory structure has only one directory which is called the root directory. In this section, we will be discussing the most common types of directories, their benefits and drawbacks. The Misc info filed in the directory contains the miscellaneous information about the owner of the file, the time of its creation, the time at which the file was modified last. Flag field contains the kind of directory entry like value D in Flag field indicates that the file is a directory, value L indicates that the file is a link, value M indicates that the file is a mounted file system. Protection Info field contains the information whether the file can be accessed by the other user in the system or not. The field File name, contains the name of the concerned file in the directory, Type field indicates the kind or category of the file, Location Info field indicates the location where the file is stored. Let us now study the directory structure with the help of the figure above. A directory always has information about the group of related files. Whenever a user or a process request for a file, the file system search for the file’s entry in the directory and when the match is found, it obtains the file’s location from there. A user must be able to share the files he creates and he must also be able to access the files, created by other users.ĭirectory structure provides both the above-discussed features. A user must have freedom of giving the desired name to the file, without taking into consideration that the same file names are used by other users on the system.Ģ. The two important features that must be taken care while maintaining a directory are given below.ġ. The file entries have information like file name, type, location, the mode in which the file can be accessed by other users in the system. The directory structure organizes these files by keeping entries of all the related files. Content: Directory Structure in OSĪ File system contains thousands and millions of files, owned by several users.
So let’s start to explore directory structure. Here, we will discuss some common schemes defining the directory structure and will also discuss some common maintenance operations that can be performed on directory structure.