Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

Heres the implementation of the blockcount function for the Shell class cpp int Shellblockcountstrin... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

More Books

Students also viewed these Operating System questions