int mflag;
} t_Flags;
-int comprimir(char *src, char *dst, Uint32 pagesize, Uint32 volumensize, t_Flags *flags, char *staticmodel);
+int comprimir(char *src, char *dst, Uint32 pagesize, Uint32 volumesize, t_Flags *flags, char *staticmodel);
int descomprimir(char *src, char *dst);
int main(int argc, char* argv[])
FILE* file;
long file_size;
- if (!(file = fopen(filename, "r"))) return -1;
+ //printf("%s!!!\n", filename);
+ if (!(file = fopen(filename, "ab"))) return -1;
+ //printf("Abrio!\n");
file_size = ftell(file);
fclose(file);
return file_size;
}
/* Limpiando */
- fclose(fp);
+ if (fclose(fp)) fprintf(stderr, "Error al cerrar archivo de entrada!\n");
bs_destroy(bs);
/* Comprimo con Huffman */
free(shuff);
/* Muestro bpb */
- printf("%s: %.04f bits/byte.\n", dst, vfsize(dst)*8.0f/fsize(src));
+ //printf("%s: %ld bytes.\n", src, fsize(src));
+ //printf("%s: %ld bytes.\n", dst, vfsize(dst));
+ printf("%s: %.04f bits/byte.\n", dst, 1.0/fsize(src)*vfsize(dst)*8.0f);
return 0;
}