G53OPS - Operating Systems

This course is run at the The University of Nottingham within the School of Computer Science & IT. The course is run by Graham Kendall (EMAIL : gxk@cs.nott.ac.uk)


Directories

Many operating systems provide some form of directory mechanism. Certainly MS-DOS, Windows and UNIX do, although, under Windows 95 Microsoft tended to call them folders but they seem to have reverted to the term directory in Windows 98 and Windows NT.

The purpose of a directory is to

· Allow like files to be grouped together
· Allow operations to be performed on a group of files which have something in common, for example, copy the files or set one of their attributes.
· Allow files to have the same filename (as long as they are in different directories). This allows more flexibility in naming files.

A typical directory entry contains a number of entries; one per file. All the data (filename, attributes and disc addresses) can be stored within the directory.

Alternatively, just the filename can be stored in the directory together with a pointer to a data structure which contains the other details.

Hierarchical Directory Systems

The common method of organising directories is to allow a tree like structure. This is, the filing system has a root directory which can contain other directories. This is by far the most common method.

An alternative is to have a single directory (the root) with all files contained within that directory. To the user, this scheme appears as if there are no directories at all.
A solution that comes in between these two is to allow a root directory and then one directory per user. This allows each user to name their files how they please but does not allow them to logically group their files further as they cannot create further sub-directories.

As an exercise, consider an operating systems that only allows one directory (the root) but does allow arbitrarily long filenames. Can you think of a way of simulating a hierarchical filing system? If so, how?

A suggested answer is at the end of this section.

Last Page Back to Main Index Next Page

 

 


 Last Updated : 23/01/2002