Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fseek(fp, br.cluster_size * br.root_dir, SEEK_SET);
- fwrite(directory_table, br.cluster_size, 1, fp);
- if(FileAllocationTable[br.root_dir] != 0xFFFF) {
- int currentCluster = FileAllocationTable[br.root_dir];
- int cur = 2;
- int max = dt_total_size;
- int dt_size = br.cluster_size / sizeof(dir_table);
- int dt_loc = br.cluster_size * br.root_dir;
- while(FileAllocationTable[currentCluster] != 0xFFFF && cur <= max) {
- dir_table* temp_dt = new dir_table[dt_size];
- for(int i = (cur - 1) * dt_size, j = 0; i < cur * dt_size, j < dt_size; i++, j++) {
- temp_dt[j] = directory_table[i];
- }
- fseek(fp, br.cluster_size * FileAllocationTable[currentCluster], SEEK_SET);
- fwrite(temp_dt, br.cluster_size, 1, fp);
- cur++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement