2
$\begingroup$

I am reading Operating System Concepts by Silberchatz, Galvin, Gagne and they write that a directory can be implemented using a linear list. [pg 470, 8th ed]

However, I visualize directories as a rather hierarchical data structure which can be implemented using a B-tree.

Also, when they say that the nodes contain a pointer to the data blocks, what do they mean?

$\endgroup$
2
$\begingroup$

A directory is a collection of files, some of which could be directories. You can store the list of files forming a directory as a linear list. This is somewhat similar to the adjacency list representation of a graph (imagine that the graph were a tree).

Each node in the list contains some sort of information regarding the file, such as the name, size and contents. The contents themselves are not stored at the list, but somewhere else in the filesystem. Each node just contains a pointer to the data, which is what is meant by data blocks. The exact way in which this is implemented depends on the file system – the main issue here is that the file isn't stored contiguously.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.