The GATE Grind

GATE 2021 CS – Question 25

Operating System · File Systems and Disk Performance · 1 mark · Multiple select

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?

  1. Creation of a new file in foo
  2. Deletion of an existing file from foo
  3. Renaming of an existing file in foo
  4. Opening of an existing file in foo

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.