]> git.llucax.com Git - z.facultad/75.06/emufs.git/blobdiff - emufs/emufs.c
emufs.h comente los campos de stats en doxy, fsc.h/c agregue la funcion para obtener...
[z.facultad/75.06/emufs.git] / emufs / emufs.c
index 33c114a5fe39a84216aa4517a7a43e7957055652..297cf9d017e76d6230c1f02fb392b675a0581688 100644 (file)
@@ -278,17 +278,15 @@ int ver_archivo_FS(EMUFS *emu)
        fprintf(stderr, "BLOQUES Y REGISTROS\n");
        strcpy(name_f_block_free,emu->nombre);
        strcat(name_f_block_free,".idx");
        fprintf(stderr, "BLOQUES Y REGISTROS\n");
        strcpy(name_f_block_free,emu->nombre);
        strcat(name_f_block_free,".idx");
+       f_block_free = fopen(name_f_block_free, "r");
        {
                EMUFS_IDX r;
        {
                EMUFS_IDX r;
-               f_block_free = fopen(name_f_block_free, "r");
-               fread(&r, sizeof(EMUFS_IDX), 1, f_block_free);
                while (!feof(f_block_free)) {
                while (!feof(f_block_free)) {
+                       if (fread(&r, sizeof(EMUFS_IDX), 1, f_block_free) != 1) continue;
                        fprintf(stderr, "ID %li en bloque %li\n", r.id_reg, r.location);
                        fprintf(stderr, "ID %li en bloque %li\n", r.id_reg, r.location);
-                       fread(&r, sizeof(EMUFS_IDX), 1, f_block_free);
                }
                }
-               fclose(f_block_free);
        }
        }
-       
+       fclose(f_block_free);
        
        return 0;
 }
        
        return 0;
 }