Category : Word Processors
Archive   : CR.ZIP
Filename : CR.C

 
Output of file : CR.C contained in archive : CR.ZIP
#include
#include

void main(int argc, char **argv)
{
FILE *infile, *outfile;
char buf[1000];
int length;
long numrecs;

if (argc != 4)
{
printf("usage: %s infile outfile length_of_record\n",argv[0]);
exit(1);
}

infile = fopen(argv[1],"r");
outfile = fopen(argv[2],"w");
length = atoi(argv[3]);

if ( (infile == NULL) || (outfile == NULL) )
{
printf("error opening files\n");
exit(1);
}

printf("reading %d byte records from %s\nand writing them to %s\n",length,argv[1],argv[2]);

numrecs = 0;
while (!feof(infile))
{
printf("\r%6ld",numrecs++);
if (fread(buf,length,1,infile) == 1)
{
fwrite(buf,length,1,outfile);
fprintf(outfile,"\n");
}
}
printf("\n");
fclose(infile);
fclose(outfile);
}

  3 Responses to “Category : Word Processors
Archive   : CR.ZIP
Filename : CR.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/