- /* Guardo el nuevo GAP que posee los tres espacios sumados */
- if (pos_gap_before < pos_gap_after) {
- fseek(f_fsc,sizeof(EMUFS_FSC)*pos_gap_before,0);
- destination = sizeof(EMUFS_FSC)*pos_gap_after;
- }
- else {
- fseek(f_fsc,sizeof(EMUFS_FSC)*pos_gap_after,0);
- destination = sizeof(EMUFS_FSC)*pos_gap_before;
- }
- gap_new.marker = gap_before.marker;
- gap_new.freespace = gap_before.freespace + freespace + gap_after.freespace;
- fwrite(&gap_new,sizeof(EMUFS_FSC),1,f_fsc);
-
- /* Preparo el escenario para la movida de registros */
- source = destination+sizeof(EMUFS_FSC); /* Salteo el gap que elimino! */
- fseek(f_fsc,0,SEEK_END);
- file_size = ftell(f_fsc);
- reg_count = (file_size - source) / sizeof(EMUFS_FSC);
-
- /* Comienzo a mover */
- while (cant_moved < reg_count) {
- fseek(f_fsc,source,0);
- fread(&gap_new,sizeof(EMUFS_FSC),1,f_fsc);
- fseek(f_fsc,-sizeof(EMUFS_FSC)*2,SEEK_CUR);
+ /* Guardo el nuevo GAP que posee los tres espacios sumados */
+ if (pos_gap_before < pos_gap_after) {
+ fseek(f_fsc,sizeof(EMUFS_FSC)*pos_gap_before,0);
+ destination = sizeof(EMUFS_FSC)*pos_gap_after;
+ }
+ else {
+ fseek(f_fsc,sizeof(EMUFS_FSC)*pos_gap_after,0);
+ destination = sizeof(EMUFS_FSC)*pos_gap_before;
+ }
+ gap_new.marker = gap_before.marker;
+ gap_new.freespace = gap_before.freespace + freespace + gap_after.freespace;