X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/7d6a6af99331d94edde2f89ce7bb78a35eb6abd6..e0748aab538eb09d53d767a305aaccc86489bf23:/tipo3/emufs.c diff --git a/tipo3/emufs.c b/tipo3/emufs.c index 4690093..3d76066 100644 --- a/tipo3/emufs.c +++ b/tipo3/emufs.c @@ -1,13 +1,11 @@ - #include "emufs.h" #include "param_cte.h" /* Defino las extenciones que usan cada tipo de archivo */ -#define EXT_TIPO3_ID ".id3" +#define EXT_TIPO3_ID ".idx" #define EXT_TIPO3_DATA ".dat" #define EXT_TIPO3_DISP ".fsc" -#define EXT_TIPO3_IDS ".idc" -#define EXT_TIPO3_EXTRA ".ids" +#define EXT_TIPO3_IDS ".ids" char *str_dup(const char *s) { @@ -67,11 +65,7 @@ EMUFS *emufs_crear(const char *filename, char tipo, unsigned int tam_bloque, uns strcat(name, EXT_TIPO3_IDS); fp = fopen(name, "w"); fclose(fp); - - strcpy(name, filename); - strcat(name, EXT_TIPO3_EXTRA); - fp = fopen(name, "w"); - fclose(fp); + break; default: free(tmp); @@ -148,5 +142,21 @@ int ver_archivo_FS(EMUFS *emu) } fclose(f_block_free); + + /* Imprimo la lista de bloques/registros */ + strcpy(name_f_block_free,emu->nombre); + strcat(name_f_block_free,".fsc"); + { + BLOCK_REG_T r; + f_block_free = fopen(name_f_block_free, "r"); + fread(&r, sizeof(BLOCK_REG_T), 1, f_block_free); + while (!feof(f_block_free)) { + printf("ID %ld en bloque %d\n", r.id_reg, r.block); + fread(&r, sizeof(BLOCK_REG_T), 1, f_block_free); + } + fclose(f_block_free); + } + + return 0; }