X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/d4f0853a534fc4283fa38cf4bb4a70cc614283ec..a8dad3d5bafadb9bca3335952462f05192a5059c:/emufs/fsc.c diff --git a/emufs/fsc.c b/emufs/fsc.c index 4aaaa17..d0d9124 100644 --- a/emufs/fsc.c +++ b/emufs/fsc.c @@ -37,8 +37,8 @@ #include "fsc.h" #include "error.h" +#include "common.h" #include -#include #include /* Crea un archivo de Gaps o Espacio Libre en Bloque */ @@ -125,7 +125,7 @@ int emufs_fsc_agregar_gap(EMUFS *emu, EMUFS_OFFSET marker, EMUFS_FREE freespace) /* Busco el gap que sucede a este */ fseek(f_fsc,0,SEEK_SET); while (!feof(f_fsc)) { - fread(&gap_aux,sizeof(EMUFS_FSC),1,f_fsc); + if (fread(&gap_aux,sizeof(EMUFS_FSC),1,f_fsc) != 1) continue; if (gap_aux.marker > gap_new.marker) { found = 1; break; @@ -568,3 +568,11 @@ EMUFS_BLOCK_ID emufs_fsc_get_num_blocks(EMUFS* efs) return cant; } +long emufs_fsc_get_file_size(EMUFS* efs, int* err) +{ + char name[255]; + strcpy(name, efs->nombre); + strcat(name, EMUFS_FSC_EXT); + return emufs_common_get_file_size(name, err); +} +