Example #1
0
 //This method checks whether there are available free data blocks in my file system
 public int readDataBlocks(SuperBlock superBlock)
 {
     for (int i = 5; i < superBlock.FreeBlocks; i++)
     {
         myPFS = System.IO.File.Open(path, FileMode.Open);
         seekBlock(i);
         using (StreamReader sReader = new StreamReader(myPFS))
         {
             if (sReader.Read() == '\0')
             {
                 return(i);
             }
         }
     }
     //-1 implies no free data blocks available
     return(-1);
 }
Example #2
0
 public MyFileSystem()
 {
     myDisk     = new Disk_1003893();
     superBlock = new SuperBlock();
     fileTable  = new FileTable();
 }