GATE CS 2021 Set 1 | Question 25

Operating Systems › File Systems & I/O · MSQ · 1 mark · Answer: A, C

  1. Question 25Operating Systemsmsq1 mark
    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?
    • A.
      Creation of a new file in foo
      ✓
    • B.
      Deletion of an existing file from foo
    • C.
      Renaming of an existing file in foo
      ✓
    • D.
      Opening of an existing file in foo

    Answer: A, C

    Solution

    Creating a new file must confirm the name does not already exist, requiring a full scan (A). Renaming must find the file and confirm the new name is unused, requiring a full scan (C). Deleting and opening can stop as soon as the file is found, so they do not necessarily scan the whole list.

More GATE PYQ on File Systems & I/O

All GATE CS Operating Systems PYQ →

Attempt GATE CS 2021 Set 1 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →