Question: help This laboratory is designed to get you started with the the second part of the project. 1. Open your source file and write or



This laboratory is designed to get you started with the the second part of the project. 1. Open your source file and write or copy the code for the class template for the Sdisk: 2. Now, copy the interface for the filesystem : int fsclose(); int newfile(string file); int rmfile(string file); int getfirstblock(string file); int addblock(string file, string block); int delblock (string file, int blocknumber); int readblcck(string file, int blocknumber, string\& buffer); int writeblock (string file, int blocknumber, string buffer); int nextblock(string file, int blocknumber); Private : int rootsize; /1 maximum number of entries in Roor int fatsize; I/ number of blocks occupied by FAT vectorsstring filename; I/ filenames in Roor vectorsints firstblock; // firstblocks in Roor vector ints fat; // FAT int buildfs () // builds the file system int readfs () // reads the file system int fssynch(); /I writes the FAT and RoOT to the sdisk 3 3. Create function stubs (functions with no code) for the class functions. 4. Work first on the Filesys constructor where you have to create the ROOT directory and the FAT. 5. Work next on the fssynch that writes the Root and FAT to the disk. Class Filesys: public Sdisk \{ Public: Filesys (string diskname, int numberofblocks, int blocksize); int fselose () int newfile (string file); int rmfile(string file) int getfirstblock (string file); int addblock(string file, string block) 5 int delblock(string file, int blocknumber); int readblock(string file, int blocknumber, string buffer); int writeblock (string file, int blocknumber, string buffer) int nextblock (string file, int blocknumber), Private i int rootsize; I/ maximum number of entries in ROOT int fatsizej // number of blocks occupied by FAT vectorcstring filenamey l/ filenames in ROOT vector(int) firstblock; /1 finstblocks in Roor vector// FAT int buildfs () // builds the file system int readfs () /I reads the fi1 e syptem int fssynch () i // writes the FAT Jand RooT to the sdisk li An explanation of the member functions follows: - Filesyou the set [0.83. - Issiseli
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
