- 2073 Magh · 1+3+6 marks
File attributes; directory systems; free blocks
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.
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.
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 |
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.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- File system layout; free block management · Operating System, chapter 5
- Directory, file path, access methods · Operating System, chapter 5
- File attributes; FS implementation ways · Operating System, chapter 5
- File and attributes; allocation methods · Operating System, chapter 5
- File attributes; levels of directories · Operating System, chapter 5
- File allocation methods; free space management · Operating System, chapter 5 · asked 2×
- Storage tank capacity and water level, 20000 L/day · Water Supply Engineering, chapter 7 · asked 2×
- GFS vs other file systems · Big Data Technologies, chapter 2
- Blocks of a data acquisition system · Digital Control System, chapter 1 · asked 2×
- Features of a typical operating system · Microprocessor, chapter 6 · asked 3×