X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/409b3712f9aafe1d8a9c2da8c5284ac0afebcfb0..5df9bdcff11e0a64b9c05ca5294d6edf0a62603f:/emufs/fsc.c?ds=inline diff --git a/emufs/fsc.c b/emufs/fsc.c index 164050e..17a7244 100644 --- a/emufs/fsc.c +++ b/emufs/fsc.c @@ -342,3 +342,29 @@ EMUFS_FREE emufs_fsc_get_total_fs(EMUFS *emu) fclose(f_fsc); return total; } +/* +EMUFS_FREE emufs_fsc_get_max_min_fs(EMUFS *emu, int *min, int *max) +{ + FILE *f_fsc; + EMUFS_FSC reg; + char name_f_fsc[255]; + + strcpy(name_f_fsc,emu->nombre); + strcat(name_f_fsc, EMUFS_FSC_EXT); + + *min = emu->tam_bloque; + *max = 0; + if ( (f_fsc = fopen(name_f_fsc,"r"))==NULL ) return -1; + + while ( !feof(f_fsc) ){ + fread(®, sizeof(EMUFS_FSC), 1, f_fsc); + if ( reg.freespace < *min ) + *min = reg.freespace; + if ( reg.freespace > *max ) + *max = reg.freespace; + } + + fclose(f_fsc); + return 0; +} +*/