Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. fseek(fp, br.cluster_size * br.root_dir, SEEK_SET);
  2.     fwrite(directory_table, br.cluster_size, 1, fp);
  3.  
  4.     if(FileAllocationTable[br.root_dir] != 0xFFFF) {  
  5.       int currentCluster = FileAllocationTable[br.root_dir];
  6.  
  7.       int cur = 2;
  8.       int max = dt_total_size;
  9.  
  10.       int dt_size = br.cluster_size / sizeof(dir_table);
  11.       int dt_loc = br.cluster_size * br.root_dir;
  12.  
  13.       while(FileAllocationTable[currentCluster] != 0xFFFF && cur <= max) {
  14.         dir_table* temp_dt = new dir_table[dt_size];
  15.  
  16.         for(int i = (cur - 1) * dt_size, j = 0; i < cur * dt_size, j < dt_size; i++, j++) {
  17.           temp_dt[j] = directory_table[i];
  18.         }
  19.  
  20.         fseek(fp, br.cluster_size * FileAllocationTable[currentCluster], SEEK_SET);
  21.         fwrite(temp_dt, br.cluster_size, 1, fp);
  22.  
  23.         cur++;
  24.       }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement