/* John Pfeiffer, 13sep08 file size by fseek/ftell - does it match file size?
YES it does - but counting by cgetc(ifp) windows counts carriage return & linefeed */
#include <stdio.h>
int main(int argc, char* argv[])
{
long size = 0;
FILE* ifp;
if( argc > 2 )
{ printf("Error! Too many parameters\n"); exit(1); }
ifp = fopen(argv[1],"rb");
if( ifp == NULL )
{ printf("error opening file\n");}
else
{ fseek(ifp, 0, SEEK_END);
size = ftell(ifp);
fclose(ifp);
}
printf("There were %ld bytes in %s.\n",size, argv[1]);
return 0;
}