GATE 2021 CS – Question 25
Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks. Consider a given directory foo. Which of the following operations will necessarily require a full scan of foo for successful completion?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) Creation of a new file in foo; (C) Renaming of an existing file in foo
Explanation
Creation must check the whole list for a duplicate name. Renaming must check that the new name is unused. Deletion and opening can stop once the file is found.