- if ( (fp = fopen(name_f_idx, "r")) == NULL ) return -1;/*EMUFS_NOT_FOUND*/;
- fseek(fp, 0, SEEK_END);
- cant = ftell(fp)/sizeof(EMUFS_IDX);
+ if ( (fp = fopen(name_f_idx, "rb")) == NULL){
+ PERR("No se pudo abrir el archivo");
+ return -1;
+ }
+
+ while ( !feof(fp) ){
+ fread(&id, sizeof(EMUFS_IDX), 1, fp);
+ if ( id.id_reg == ID ){
+ fclose(fp);
+ return 0;
+ }
+ }