10.6

You can simulate a multilevel directory structure with a single level directory structure and arbitrarily long file names. To do this we will use a special character, say #, as the directory delimiter and we will specify a file as its path followed by the # symbol then the file name. A program then that wanted to use the concept of a current working directory could then just perform this concatenation of the path with the filename when a file is accessed. A file perl in directory /usr/local/bin/ would have a file name of #usr#local#bin#perl

Note that a directory has many other features such as access permissions directory data could be stored in a file that ends with the # symbol if necessary. File protection facilities could be added into the operating system as well, but they could not be enforced if this is to be implemented as a user level library. The directory /usr/local/bin/ would have its directory data in a file called #usr#local#bin#.

If we were to instead limit the file names to seven characters, we could still simulate directories but it is much more complicated. In fact we could simulate the low level inode/block mechanism. Each file in our system would be named with an identifier that could be looked up in another file to get matched with a name. This can be done in exactly the same way that directories are done with inodes in a typical file system.

10.12

  1. In UNIX it can be done one of two ways.

    First, you could make a group, access, add all 4990 users that you want to have access to this file in this group, and then chmod the file like this:

    -rw-rw----    jason    access         1266 Mar  4 00:22 sol4.html

    The second way you can do this in UNIX is more tricky. User group access is checked before global access is checked so you can create a group, deny, and chmod the file like this:

    -rw----rw-    jason    deny           1266 Mar  4 00:22 sol4.html
  2. This seems pretty effective to me. If we could not do the second scheme in UNIX then I would suggest something like that.