
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
A hard disk partition is formatted with a file system based on chained allocation, using an allocation table. The partition formatting considered a block (cluster) size of 4096 bytes. A program executed on this computer creates a file in this partition and writes the file data according to the code snippet below. As a result, the created file contains ____ bytes and occupies ____ bytes in the file system's data area.
...
05 char dado;
...
25 for(i=0;i<1024;i++)
27 write(fd, &dado, 1);
28 close(fd);
...
05 char dado;
...
25 for(i=0;i<1024;i++)
27 write(fd, &dado, 1);
28 close(fd);
Select the alternative that correctly and respectively fills in the blanks in the text above.
A
1024 – 1024
B
1025 – 1025
C
1024 – 4096
D
1025 – 4096
E
4096 – 4096
Explanation:
This question tests understanding of file system allocation methods and cluster/block sizes.
for(i=0;i<1024;i++))In chained allocation with allocation tables (like FAT), files are stored in clusters. Even if a file uses only part of a cluster, the entire cluster is allocated to that file. This is known as internal fragmentation - wasted space within allocated clusters.
Correct Answer: C (1024 – 4096)