home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
-
- main(argc, argv)
- int argc;
- char **argv;
- {
- FILE *datafile, *ofile;
- int i, c;
-
- if (argc != 3) {
- fprintf(stderr, "Arg count.\n");
- exit(1);
- }
- datafile = fopen(argv[1], "r");
- ofile = fopen(argv[2], "a");
- i = 0;
- for (;;) {
- c = getc(datafile);
- if (feof(datafile))
- break;
- putc(c, ofile);
- i++;
- }
- fwrite((char *)(&i), 4, 1, ofile);
- fclose(datafile);
- fclose(ofile);
- }
-