In a filesystem, which data structure stores information about a file or directory such as its size, location, and permissions?

Prepare for the GATE General Aptitude and CS Test. Enhance your skills with multiple choice questions and detailed explanations. Elevate your readiness and boost your confidence for the exam!

Multiple Choice

In a filesystem, which data structure stores information about a file or directory such as its size, location, and permissions?

Explanation:
The metadata container that holds information about a file, including its size, where its data is stored, and what permissions apply, is the inode. An inode stores the file’s size in bytes, the ownership (user and group IDs), the permission bits, timestamps, and pointers to the actual data blocks on disk. The file name isn’t stored in the inode itself; instead, a directory entry links a name to the inode, allowing the filesystem to locate the file’s metadata and data separately. The pointers inside the inode tell the system where to read or write the file’s contents, which is why this structure uniquely fits the description. Other options don’t cover all these aspects: a directory entry mainly maps a name to an inode and may hold a few attributes, but not the full metadata and block pointers; the File Allocation Table maps clusters to form the file’s data layout in FAT systems, not the file’s metadata; a file descriptor is a per-process handle created at open time, not a persistent on-disk structure.

The metadata container that holds information about a file, including its size, where its data is stored, and what permissions apply, is the inode. An inode stores the file’s size in bytes, the ownership (user and group IDs), the permission bits, timestamps, and pointers to the actual data blocks on disk. The file name isn’t stored in the inode itself; instead, a directory entry links a name to the inode, allowing the filesystem to locate the file’s metadata and data separately. The pointers inside the inode tell the system where to read or write the file’s contents, which is why this structure uniquely fits the description.

Other options don’t cover all these aspects: a directory entry mainly maps a name to an inode and may hold a few attributes, but not the full metadata and block pointers; the File Allocation Table maps clusters to form the file’s data layout in FAT systems, not the file’s metadata; a file descriptor is a per-process handle created at open time, not a persistent on-disk structure.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy