Here is some C++ code that can do this:
#define max_file_size 102400
char buffer[max_file_size];
long file_size, len1, len2;
int num_blocks;
int file_in, file_out;
file_in = _open(input_file, _O_BINARY | _O_RDONLY);
file_size = filelength(file_in);
num_blocks = (int)(file_size / 102400)...