1,672 views
0 votes
0 votes

How many disk operations are needed to fetch the i-node for a file with the path name /usr/ast/courses/os/handout.t? Assume that the i-node for the root directory is in memory, but nothing else along the path is in memory. Also assume that all directories fit in one disk block.

1 Answer

1 votes
1 votes

The following disk reads are needed:

directory for /

i-node for /usr

directory for /usr

i-node for /usr/ast

directory for /usr/ast

i-node for /usr/ast/courses

directory for /usr/ast/courses

i-node for /usr/ast/courses/os

directory for /usr/ast/courses/os

i-node for /usr/ast/courses/os/handout.t

In total, 10 disk reads are required.

Ref: Tanenbaum Solution

Related questions

0 votes
0 votes
0 answers
2
0 votes
0 votes
0 answers
4
admin asked Oct 27, 2019
276 views
Write a program that reverses the bytes of a file, so that the last byte is now first and the first byte is now last. It must work with an arbitrarily long file, but try ...