GateAI
File Systems

GATE CSE 2021 Set 1 · Q15

MSQ1 markMedium

Time

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?

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

Official answer: A) Creation of a new file in foo; C) Renaming of an existing file in foo

File Systems

In a linear list implementation of a directory:

  1. Creation of a new file (Option A): Before adding a new entry, the file system must ensure that no existing file in the directory already has the same name. To confirm uniqueness in an unsorted linear list, every node must be checked. Therefore, creating a new file necessarily requires a full scan of the directory.

  2. Renaming an existing file (Option C): When renaming a file to a new target name, the file system must verify that no other file already exists with that new name. Verifying the non-existence of the new name requires scanning the entire directory list.

  3. Deletion (Option B) & Opening (Option D): Both of these operations search for a specific existing file. As soon as the matching node is found in the list, the search terminates immediately (the node is unlinked/deleted or its metadata is accessed). A full scan is only needed in the worst case (when the file is at the very end), so they do not *necessarily* require a full scan.

Thus, options A and C are correct.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This File Systems previous year question is Q15 of the GATE CSE 2021 Set 1 paper. Find more GATE CSE PYQs on File Systems in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related File Systems PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

File Systems in GATE CSE

File Systems has 14 GATE CSE PYQs across 14 papers from 2011 to 2026. This is the only 1-mark MSQ among them, and it is the only one in GATE CSE 2021 Set 1.

How GATE tests File Systems

More from GATE CSE 2021 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2021 Set 1 · Q15 · MSQ

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?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.