---
title: "File attributes; directory systems; free blocks"
subject: "Operating System"
chapter: 5
key: "semester_6/operating_system:file-attribute-directory-free-blocks"
source: https://www.bctengineer.com/q/semester_6/operating_system/file-attribute-directory-free-blocks
site: BCT Engineering
---

# File attributes; directory systems; free blocks

Operating System · Chapter 5: File Systems

- Asked in: 2073 Magh, 1+3+6 marks
- Video: [OS63 - Introduction to Files | Directory](https://www.youtube.com/watch?v=IccVcjB1RsE) — EZCSE
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/file-attribute-directory-free-blocks
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-5

## Question

What is File Attribute? Write the difference between Single level directory system and Hierarchical directory system. Explain how operating system manages free blocks of Secondary storage.

## Short answer

A file attribute is metadata (name, size, owner, permissions, timestamps). Single-level directory forces unique names for all files; hierarchical allows directories and subdirectories, enabling grouping and pathnames. Free blocks are managed by bitmap, linked list, grouping, counting, or free-list blocks.

## Answer

#### File attribute
A **file attribute** is a piece of metadata about a file, such as its name, type, size, location, owner, permissions and time stamps (creation, modification, last access).

#### Single-level vs hierarchical directory
| Point | Single-level directory | Hierarchical (tree) directory |
|---|---|---|
| Structure | One directory holds all files of all users | Directories contain files and sub-directories, forming a tree |
| Naming | All names must be unique | Same name allowed in different directories |
| Grouping | Not possible | Files can be grouped logically (by user/project) |
| Searching | Slow for many files | Faster; search along a path |
| Path names | Just a file name | Absolute or relative path (`/home/ram/a.c`) |
| Multi-user | Poor, name clashes, no privacy | Good, per-user directories and protection |
| Example | Early systems (CP/M) | UNIX, Windows |

```text
 single:  [ a  b  c  d  e ... ]         tree:     root
                                               /      \
                                             usr      home
                                              |      /    \
                                             bin   ram    sita
```

#### Management of free blocks
The OS keeps track of free disk blocks by:
- **Bit map:** one bit per block (1 = free). Example: 0011010011... shows blocks 2, 3, 5, 8, 9 free. Easy to find contiguous blocks; a 16 GB disk with 1 KB blocks needs 2 MB.
- **Linked list:** each free block holds the number of the next free block; the head is kept by the OS. No extra space but slow.
- **Grouping:** the first free block holds *n* free block addresses, the last of which points to another such block.
- **Counting:** store (first free block, count of consecutive free blocks), e.g. (2,2), (5,1), (8,2).
- **Free-list blocks:** a block stores many free block numbers (e.g. 255 per 1 KB block) and is read when needed.

The chosen block is removed from the structure on allocation and added again on deletion.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is a file attribute?
   A. A piece of metadata about a file, such as name, type, size, owner, permissions and time stamps
   B. The actual data stored in a file
   C. A pointer to the next free block
   D. The directory containing the file
   Answer: A. Attributes describe the file, not its content. (Key point: File attribute)

2. What naming difference exists between single-level and hierarchical directories?
   A. Hierarchical needs all names unique
   B. Single-level needs all names unique; hierarchical allows the same name in different directories
   C. Single-level allows the same name for different users
   D. Both allow identical names in one directory
   Answer: B. Because one directory holds everything in single-level, names clash; trees separate names by path. (Key point: Single vs hierarchical naming)

3. In a bit map free-space scheme with 1 = free, 0011010011... means which blocks are free?
   A. Blocks 0, 1, 4, 6 and 7
   B. Blocks 1, 2, 4, 7 and 8
   C. Blocks 2, 3, 5, 8 and 9
   D. Blocks 0, 1, 2 and 3
   Answer: C. Counting from 0, the 1 bits are at positions 2, 3, 5, 8, 9. (Key point: Bit map)

4. The counting method of free-space management stores:
   A. One bit per block
   B. The next free block number in each free block
   C. A list of all used blocks
   D. The first free block and the number of consecutive free blocks
   Answer: D. Entries such as (2,2) mean 2 free blocks starting at block 2. (Key point: Counting method)

## Related in Operating System

- [File system layout; free block management](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afs-layout-free-blocks) — Operating System, chapter 5
- [Directory, file path, access methods](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Adirectory-file-path-access-methods) — Operating System, chapter 5
- [File attributes; FS implementation ways](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afile-attribute-implementation-best) — Operating System, chapter 5
- [File and attributes; allocation methods](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afile-attributes-allocation-methods) — Operating System, chapter 5
- [File attributes; levels of directories](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afile-attributes-directory-levels) — Operating System, chapter 5
- [File allocation methods; free space management](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afile-allocation-free-space-methods) — Operating System, chapter 5, asked 2×

## Related in other subjects

- [Storage tank capacity and water level, 20000 L/day](https://www.bctengineer.com/question.md?key=semester_5%2Fwater_supply_engineering%3Areservoir-level-river-20000) — Water Supply Engineering, chapter 7, asked 2×
- [GFS vs other file systems](https://www.bctengineer.com/question.md?key=semester_8%2Fbig_data_technologies%3Agfs-differ-other-fs) — Big Data Technologies, chapter 2
- [Blocks of a data acquisition system](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adata-acquisition-system-blocks) — Digital Control System, chapter 1, asked 2×
- [Features of a typical operating system](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Afeatures-of-operating-system) — Microprocessor, chapter 6, asked 3×
