Introduction
Announcements

Schedule
Labs
Assignments
TA office hours

Tests, exam

Topic videos
Some course notes
Extra problems
Lecture recordings

Discussion board

Grades so far

2. [6 marks]
Here is a portion of a unix filesystem. Like the "ls -l" output, we list whether the file (inode) is a plain file, directory, etc, with '-' for plain file or 'd' for directory. In the case of directories, the table also states the data content of the directory itself (a list of pairs of: inode number, name).
2d. 2, .. 2, usr 7, etc 4, bin 6
3- 
4d. 4, .. 2, passwd 3
5d. 5, .. 7, fsys.fig 10, src 11
6d. 6, .. 2, date 9
7d. 7, .. 2, bin 8, ajr 5, you 12
8d. 8, .. 7
9- 
10- 
11d. 11, .. 5, hello.c 13
12d. 12, .. 7, a1 14
13- 
14- 
15  
16  
17  

a) Suppose I do "mkdir /usr/ajr/newdir". Write in all changes/additions to the above list. (There are some free inodes at the end for you to use for new files.)

b) If instead I were cd'd to /usr/ajr and typed simply "mkdir newdir". would the result differ, and if so, how?

c) Suppose I do "ln -s /usr/you/a1 /usr/ajr/othera1", creating a "symbolic link". Write in all changes/additions to the above list.

d) If instead I were cd'd to /usr/you and typed "ln -s a1 /usr/ajr/othera1", would the result differ, and if so, how?

Solutions:

2a)

2b) no difference

2c)

2d) inode 16's contents would be "a1". So it wouldn't work (because it would be relative to /usr/ajr).


[sample midterm from Fall 2011]