CSE 461 Lab 4 solved

$30.00

Category: Tags: , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (4 votes)

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

  1. Here is the interface for the filesystem :
    Class Filesys: public Sdisk
    {
    Public :
    Filesys(string filename,int numberofblocks, int blocksize);
    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 Filesys and fssynch from Laboratory 3 working.

  2. Work on newfile, rmfile, getfirstblock. Note that these functions should have very little code. The first two modify ROOT so you will have to write to the Sdisk using fssynch.
  3. Now work on addblock. You can test your software with the test main program here.
  4. Finally work on delblock.