+ /*busco el registro que tengo que eliminar*/
+ if ( (f_block_reg = fopen(name_f_block_reg,"r+")) == NULL ) return -1;
+ while ( !feof(f_block_reg) ){
+ if ( fread(®_b,sizeof(BLOCK_REG_T),1,f_block_reg) != 1 ) continue;
+ if ( reg_b.id_reg == ID )
+ break;
+ }
+ printf("registro borrado= %ld en bloque = %d\n",reg_b.id_reg,reg_b.block);
+ /*justifico en archivo a la izquieda*/
+ while ( !feof(f_block_reg) ){
+ cant = fread(&buffer,sizeof(BLOCK_REG_T),10,f_block_reg);
+ fseek(f_block_reg, -cant*sizeof(BLOCK_REG_T)-1, SEEK_CUR);
+ for (i=0; i<cant; i++){
+ fwrite(&buffer[i],sizeof(BLOCK_REG_T),1,f_block_reg);
+ if ( feof(f_block_reg) ) continue;
+ }
+ if ( feof(f_block_reg) ) continue;
+ fseek(f_block_reg, sizeof(BLOCK_REG_T), SEEK_CUR);
+ }