diff options
Diffstat (limited to 'bgrep.cpp')
-rw-r--r-- | bgrep.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,22 +1,22 @@ #include <stdio.h> #include <stdlib.h> -#include "fileutils.h" +#include "Input.h" #define THRESHOLD 20480 int main(int argc, char ** argv) { unsigned int p = strtol(argv[1], 0, 0); char * fn = argv[2]; - FILE * f = fopen(fn, "r+"); + Handle * f = new Input(fn); if (!f) { printf("Bleeh.\n"); exit(-1); } - int l = filesize(f), i; + int l = f->GetSize(), i; char * b = (char *) malloc(l); - fread(b, 1, l, f); + f->read(b, l); for (i = 0; i < l - 3; i++) { unsigned int r = *((unsigned int *) &(b[i])); @@ -25,5 +25,5 @@ int main(int argc, char ** argv) { } } - fclose(f); + delete f; } |