home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Troubleshooting Netware Systems
/
CSTRIAL0196.BIN
/
attach
/
pcc
/
v08n03
/
netwrk.exe
/
DOSRIFS.ZIP
/
RIFSSRC.ZIP
/
CRC.C
< prev
next >
Wrap
Text File
|
1994-05-14
|
643b
|
33 lines
#include <stdio.h>
#include <stdlib.h>
#include "crc32.h"
void main(int argc, char **argv)
{
int ii;
char *buf=malloc(16384);
int read;
for (ii=1; ii < argc; ii++) {
FILE *f=fopen(argv[ii], "rb");
long totalread=0;
unsigned long CRC=0;
if (f) {
do {
read=fread(buf, 1, 16384, f);
totalread += read;
CRC = crc32(CRC, buf, read);
} while (read == 16384);
fclose(f);
printf("File (%s) Length (%ld) CRC32 (%lx)\n",
argv[ii], totalread, CRC);
} else
printf("File (%s) cannot open\n", argv[ii]);
}
free(buf);
}