Directory Structure And Detail Note On Types Of Directory Structure In Operating System

Are you looking for information regarding Directory structures in an Operating System? There are many types of directory structure in Operating System and each directory structure has some advantages and disadvantages. Read this article for complete information.

Directory Structure

There are many types of directory structure in Operating System. They are as follows :-

1) Single Level Directory
2) Two Level Directory
3) Tree Structured Directory
4) Acyclic Graph Directory
5) General Graph Directory

1) Single Level Directory

In Single Level Directory all files are in the same directory.

Limitations of Single Level Directory

a) Since all files are in the same directory, they must have unique name.

b) If two user call their data free test, then the unique name rule is violated.

c) Files are limited in length.

d) Even a single user may find it difficult to remember the names of all files as the number of file increases.

e) Keeping track of so many file is daunting task.

2) Two Level Directory

i) Each user has Its own User File Directory (UFD).

ii) When the user job start or user log in, the system Master File Directory (MFD) is searched. MFD is indexed by user name or Account Number.

iii) When user refers to a particular file, only his own UFD is searched.

Thus different users may have files with same name. To have a particular file uniquely, in a two level directory, we must give both the user name and file name.

A two level directory can be a tree or an inverted tree of height 2

The root of a tree is Master File Directory (MFD).

Its direct descendents are User File Directory (UFD). The descendents of UFD's are file themselves.

The files are the leaves of the tree.

Limitations of Two Level Directory

The structure effectively isolates one user from another.

3) Tree Structured Directory

A directory (or Sub directory) contains a set of files or sub directories. All
directories has the same internal format.

i) One bit in each directory entry defines the entry.

ii) Special calls are used to create and delete directories.

iii) Each process has a current directory. Current directory should contain most of the files that are of current interest to the process.

iv) When a reference is made to a file, the current directory is searched.

v) The user can change his current directory whenever he desires.

vi) If a file is not needed in the current directory then the user usually must either specify a path name or change the current directory.
Paths can be of two types :-

a) Absolute Path
Begins at root and follows a path down to the specified file.

b) Relative Path
Defines a path from current directory.

vii) Deletions if directory is empty, its entry in the directory that contains it can simply deleted. If it is not empty : One of the Two approaches can be taken :-
a)User must delete all the files in the directory.

b)If any sub directories exist, same procedure must be applied.
The UNIX rm command is used.
MS dos will not delete a directory unless it is empty.

4) Acyclic Graph Directory

Acyclic Graph is the graph with no cycles. It allows directories to share sub directories and files. With a shared file, only one actual file exists, so any changes made by one person are immediately visible to the another.

Implememtation of Shared files and directories

i) To create a link

. A link is effectively a pointer to another file or sub directory.

. Duplicate all the information about them in both sharing directories.

ii) Deleting a link

. Deletion of the link will not effect the original file, only link is removed.

. To preserve the file until all references to it are deleted.

Related Articles

More articles: Operating system types


Guest Author: Sakshi30 Nov 2016

Please explain General graph directory. It is mentioned above but not explained.

Guest Author: Deva03 Mar 2017

Thank you for your help madam.

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: