Which file-allocation method requires the file size to be specified when the…

2023

Which file-allocation method requires the file size to be specified when the file is created?

Answer: A. Contiguous allocationConceptA file-allocation method defines how a file’s logical blocks are placed on secondary storage and how those blocks are located later. When a method…

  1. A.

    Contiguous allocation

  2. B.

    Linked allocation

  3. C.

    Indexed allocation

  4. D.

    None of these methods

Attempted by 208 students.

Show answer & explanation

Correct answer: A

Concept

A file-allocation method defines how a file’s logical blocks are placed on secondary storage and how those blocks are located later.

When a method reserves one consecutive run of blocks, the system must know the required run length at creation time; methods that follow pointers or an index can add blocks without reserving one complete run in advance.

Application

Contiguous allocation reserves adjacent blocks for the file. The number of blocks to reserve follows from the file size, so that size must be specified when the file is created.

Contrast

  • Linked allocation can append another block by updating the chain pointer, without reserving one continuous run.

  • Indexed allocation can add another data-block address to its index structure, subject to the index’s capacity.

  • “None of these methods” would apply only if none of the named methods required advance sizing, which conflicts with contiguous allocation’s reservation model.

Cross-check

If the file later grows beyond its reserved contiguous run and the following blocks are occupied, it may have to be relocated or extended through an additional extent. This growth difficulty confirms why the initial size is needed.

Therefore, the required method is contiguous allocation.

Explore the full course: Computer Science

Loading lesson…