CSE 461 Lab 5 solution

$24.99

Original Work ?

Download Details:

  • Name: Lab-5-egsdxz.zip
  • Type: zip
  • Size: 8.54 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (3 votes)

This laboratory is designed to complete the second part of the project.

  1. Here is the interface for the filesystem :
    Class Filesys: public Sdisk
    {
    Public :
    Filesys(string filename);
    int fsclose();
    int fssynch();
    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 readblock(string file, int blocknumber, string& buffer);
    int writeblock(string file, int blocknumber, string buffer);
    int nextblock(string file, int blocknumber);
    Private :
    int rootsize;           // maximum number of entries in ROOT
    int fatsize;            // number of blocks occupied by FAT
    vector<string> filename;   // filenames in ROOT
    vector<int> firstblock; // firstblocks in ROOT
    vector<int> fat;             // FAT
    };
    

    Make sure you have everything from Laboratory 3 and Laboratory 4 working.

  2. First work on checkblock which checks if a block belongs to a file. Add the function to the private area of the interface.
  3. Work on readblock, writeblock, and nextblock. Note that these functions should have very little code if using checkblock.
  4. Now work on delblock. You can test your software with the test main program here.