Showing posts with label disk-organization. Show all posts
Showing posts with label disk-organization. Show all posts

Need for Directories

You are already aware that files are stored on external storage media. There could be many files on a disk, and this may pose a problem when a^particular file has to be located. Therefore, files must be organized in an orderly manner.

To understand this concept of file organization on a disk, let us take the example of a library. Figure shows the library layout.

You can see that the library has four floors and each floor has books belonging to a certain area of learning (arts, science, engineering, and so on). Each floor has been divided into a number of rooms, which contain books dealing with a specific subject within the area.

Thus, the school of arts has been divided into four sub-units. If you wish to locate a book on Indian history, you do not have to search through the entire library. You can go directly to the school of arts where you would find all books on history in the third room. This helps you locate the particular book you want much faster than if you were to search through the entire library, or even the entire first floor containing books pertaining to the school of arts. Since you know that the book on Indian history is likely to be in the History room, you would only have to look for ft there. Just like the books in a library are arranged in a structured manner, so should the files be arranged on a storage medium.

Library Floors and Rooms

Library Floors and Rooms

Organization of Files in Directories and Subdirectories

Let us assume that you have three files. One contains details like names, ages and addresses of all the employees in a firm, another contains details of salaries of the employees, and a third contains the details of loans given to the employees. All these files relate to the employees of the firm. Therefore, it would be desirable to put all these files together, under a single unit.

To enable the user to arrange files within units and sub-units, DOS provides structures called directories on a disk. Directories have names, just as the floors of the library in the earlier example.

Let us assume that you wish to keep three kinds of files on a disk: LETTERS files, EXPENCES files and INCOME files. Within the EXPENCES files, you wish to further classify the files as PERSONAL and OFFICIAL EXPENSE files. DOS helps you to create a structure as shown in Figure.

In the structure in Figure, the Letters directory is a subdirectory of the root directory. PERSONAL is the subdirectory of EXPENSES. EXPENCES can also be called the parent directory of the PERSONAL directory.

All files relating to a particular subject can be kept together under a directory. The root directory in DOS is denoted by a backslash (\)

The directory structure resembles an inverted tree where the main directory is the root; hence it is called the root directory.

Root Directory and Subdirectories

Root Directory and Subdirectories