diff options
author | Pixel <Pixel> | 2002-08-25 14:39:48 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2002-08-25 14:39:48 +0000 |
commit | 38d60726082b04e79edae1c8c797c6dcb8314504 (patch) | |
tree | 4a056a158c6fc21c29dd8d8ed94c010a25cee19a /bgrep.cpp | |
parent | 1b0a5db816b7610c83615e93095155b1709f55da (diff) |
Workiiiiiiiiiiiiiiiiiing!!!!
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; } |