Question: Write a function blockcount for the Shell class int Shell::blockcount(string file) which accepts a file name file and returns the number of blocks used by

The root directory ROOT and file allocation table FAT will be needed for problems 1, 2 and 3. ROOT and FAT Write a function blockcount for the Shell class


int Shell::blockcount(string file) 


which accepts a file name "file" and returns the number of blocks used by that file. Note this function can be used to determine the storage used by the file. Note that your function may not directly access the FAT or ROOT. It may only use functions from the Filesys class.

The root directory ROOT and file allocation table FAT will be needed for problems 1, 2 and 3. ROOT and FAT are tables defined as follows. The ROOT table has 6 entries and the FAT has 16 entries. The first column of the ROOT is the file name and the second column indicates the first block of the file. The only column of the FAT is the link. field which indicates the next block in the file. In the FAT, a 0 indicates the entry is the last block in the file. The first free block in the free list is given in FAT[0]. 1 F1 | 8 | 2 | F2 | 6 | 3 | F3 | 4 | 51 6 1 ROOT 0 | 16 | | T I | 10 2 | 0 | 3 | 4 | 4 | 5 5 | 0 60 7 | 3 | 8 | 91 9 11 10 | 0 11 | 12 12 | 0 | 13 | 14 | 13 15 | 14 | 16 15 | DIAGRAM 1 FAT 18080880 | I | A. B. D. FAT (Problem 2) E. 1 | F1 | 2 | F2 | 3 | F3 | ROOT (Problem 2) DIAGRAM 2

Step by Step Solution

3.36 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the implementation of the blockcount function for the Shell class cpp int Shellblockcountstrin... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!