#include <stdio.h>
#include <unistd.h>
-long get_file_size(const char* filename);
+long fsize(const char* filename);
typedef struct _flags_ {
int cflag;
return 0;
}
-long get_file_size(const char* filename)
+long fsize(const char* filename)
{
FILE* file;
long file_size;
- if (!(file = fopen(filename, "ab"))) return -1;
+ if (!(file = fopen(filename, "r"))) return -1;
file_size = ftell(file);
fclose(file);
return file_size;
free(shuff);
/* Muestro bpb */
- printf("%s: %.04f bits/byte.\n", dst, get_file_size(dst)*8.0f/get_file_size(src));
+ printf("%s: %.04f bits/byte.\n", dst, vfsize(dst)*8.0f/fsize(src));
return 0;
}
free(shuff);
return 0;
}
+