FILESPLT     Split large files into smaller more managable files

This software is covered by the GNU GENERAL PUBLIC LICENSE
Copyright (C) 1998 John E. Rice jrice@mis.pyramid.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; 

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

send email to jrice@mis.pyramid.com

I had need to split large files and then put them on floppies so I could 
transfer them to a PC.
I didn't care much for the way "split" handled spliting files. 
There was no consistency or control of the file sizes. And to
make things worst the files had to be recombined by cat'ing. On
top of that there is no type of error checking.

I wrote "filesplt" to make the task easier, at least for me.
A professional programmer I'm not, so the coding is not fancy, 
and there may be some bugs in, but it gets the job done.

"Filesplt" will split files into multiple files of the same size 
(within 1 byte), generates a check sum and stores information about
the file in a text file as an aid in rejoining the files to the orginal.

Here are some of the features of "filesplt"

File may be split into as many as 999 files (-F) 
File may be split by byte count (-B)
The output files can be renamed (-O) 
Can rejoin (-J) the files.
Check sum (32 bit crc) and filesize are calculated while file is being 
split and verified when rejoined.
Filesplt will pause (-P) to allow a floppy/disk to be removed/inserted. 
Can be compiled to ran under DOS or UNIX 

Options
-S  -split a file into multiple files
-J  -rejoin the files back into the orginal file
-O  -give the outfile a different name (-S or -J option) -optional
-F  -split the infile into n number of files (-S or -J option)
-B  -split the infile into n number of bytes (-S option only)
    -either -B or -F option may be used, but not both
-C -calculate a crc for the file (stand alone) -optional
-P -pause between each file (-S or -J option) -optional
   -the pause feature is automatic for the DOS version (floppy A or B only).

 
When a file is split, the output files will assume an extension that
is related to the order of the file in the split. 
Example: if spliting a file into 4 files (-F) the output files will 
append the file number to the filename. so what you end up with 
are 4 files with an extenstion of .001, .002, .003, .004 and a 5th 
file with an extenstion of .000. This 5th file (.000) contains 
information about the file including such things as filesize, filename, 
date and time and the all important check sum.

Included in this archive is the executable version for DOS and a static
linked version for linux slakware version 3.2.

Compiling FILESPLT
The DOS version was complied with Turbo C ver 2.
I was able to compile it on several unix platforms (including LINUX).
It should compile with any "ansi" C compiler both dos and unix as I 
tried to keep the code as "ansi" as possible. But some tweaking of the 
source code may be required.
There is one warning while compiling the unix version that I don't know
how to fix, but it doesn't seem to cause any problems.

Examples of how to compile filesplt
DOS using TURBO C
 tcc -mc filesplt.c
NOTE: when compiling for DOS, it must be compiled as a "compact" model.

LINUX with dynamic linked libraries
 gcc -DDNT="\"`\date`\"" filesplt.c -o filesplt

LINUX with static linked libraries
 gcc -static -DDNT="\"`\date`\"" filesplt.c -o filesplt

NOTE: the macro "DNT" passes the time and date at compile time to
      the final executable as a methode of tracking it's creation.

Typing the filename alone on the command line will return a brief
discription and usage such as follows.

Split large files into smaller more managable files
USAGE: filesplt [-S infile | -J infile] [-F n | -B n] [-O outfile] [-P] [-C file]
-S infile   -split a large file into multiple files
-J infile   -rejoin the files back into the orginal file
-O outfile  -give the outfile a different name (-S or -J option) -optional
-F n        -split the infile into n number of files (-S or -J option)
-B n        -split the infile into n number of bytes (-S option only)
            -either -B or -F option may be used, but not both
-C file     -calculate a crc for the file (stand alone)
-P          -pause between each file (-S or -J option) -optional
EXAMPLE: filesplt -S FILENAME.EXE -F 4 -P
         filesplt -S FILENAME.EXE -B 10000
         filesplt -J FILENAME -O REJOINED
         filesplt -J FILENAME -F 4
         filesplt -J FILENAME -P
         filesplt -C FILENAME.EXE
The file with the extension of .000 contains file parameters and information
To rejoin the files without filesplt, rename or remove file.000, then
         cat FILENAME.00? > FILENAME.EXE
filesplt (Version 2) created Wed Jan 14 22:07:07 PST 1998

If you modify the source code please email me your changes so I can include
it (that is if I like it) in my source code.

Credits
The cksum portion of the code was taken in part from the gnu program cksum.c.
Written by Q. Frank Xia, qx@math.columbia.edu.
and David MacKenzie, djm@gnu.ai.mit.edu.


