Category : Miscellaneous Language Source Code
Archive   : HACKROM.ZIP
Filename : LSPLIT.C

 
Output of file : LSPLIT.C contained in archive : HACKROM.ZIP
/* This program is designed to londitudinally split files.
It expects two arguments, the first argument specifies
the maximum length of the target files, and the second
the name of the source file.
The target files are named F0 - Fn.
*/
#include
#include
main(argc,argv)
int argc;
char **argv;
{
int i, c, x;
char fp[5];
FILE *outfile, *infile;
if (argc != 3)
{
printf("Argument error");
exit(0);
}
argv++; /* get the maximum target file size */
i = atoi(*argv);
argv++; /* get the source filename*/
if ((infile = fopen(*argv, "rb")) == NULL)
{
perror("Can't open input file");
exit(0);
}
fp[0] = 'F';
fp[2] = 0;
c = 0;
for ((fp[1] = '0'); (((c = getc(infile)) != EOF) && (fp[1] <= '9')); fp[1]++)
{
x = 2;
outfile = fopen(fp, "wb");
putc(c, outfile);
while ((x <= i) && ((c = getc(infile)) != EOF))
{
putc(c,outfile);
x++;
}
fclose(outfile);
}
fclose(infile);
if (fp[1] > '9')
printf("Warning - more than 9 files required");
exit(0);
}


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : HACKROM.ZIP
Filename : LSPLIT.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/