CSS Optional — Paper-II, Section-A · P-II.III.VII
A file is a named collection of related information recorded on secondary storage. Typical attributes tracked by the OS: name, identifier (unique internal number), type, size, location (pointer to storage blocks), protection (permissions), and timestamps (creation/last-modified/last-accessed).
| Method | How it works | Best suited for |
|---|---|---|
| Sequential Access | Records read/written strictly in order from the start; reaching record N requires reading through N−1 first | Bulk processing, magnetic tape, log files |
| Direct (Random) Access | Any block can be accessed directly by its block number, no need to pass through preceding blocks | Databases, indexed files, magnetic/solid-state disks |
| Indexed Sequential Access (ISAM) | Records kept in sequential order PLUS a separate index maps key values to approximate locations — a fast index lookup narrows the search, then a short sequential scan finds the exact record | Systems needing both fast direct lookup and full sequential scans, e.g. a keyed database table |
Random Access (as a memory/storage property, distinct from "Direct Access" file method): any location can be accessed in approximately equal time regardless of physical position — true of RAM and, at the block level, of disks; NOT true of sequential media like magnetic tape.
The Logical File System layer manages metadata and provides the file abstraction to applications (as opposed to the physical layer that manages actual disk blocks):
| Aspect | UNIX (e.g. ext4) | Windows (NTFS) |
|---|---|---|
| Structure | Single hierarchical tree rooted at "/"; all devices mounted as subdirectories of one tree | Multiple independent root volumes, each with its own drive letter (C:, D:, …) |
| Permissions | Simple owner/group/other model, read-write-execute (rwx) bits | Access Control Lists (ACLs) — fine-grained, per-user/per-group permissions |
| Metadata structure | <b>Inodes</b> — data structures holding metadata + block pointers | <b>Master File Table (MFT)</b> tracking metadata and locations |
| Naming | Case-sensitive | Case-insensitive but case-preserving |
| Philosophy | "Everything is a file" — devices/pipes treated as files too | Richer per-object security model for desktop/enterprise use |
Both support journaling for crash recovery. UNIX's simpler, uniform model suits portable, scriptable, multi-user server environments; NTFS's richer ACL-based model suits Windows' typical desktop/enterprise environments needing granular per-user security control.