[comp.sys.ibm.pc] Copying very large files

wordproc@ucf-cs.UCF.EDU (wordproc) (11/23/89)

I have a very large file on my MSDOS 4.01 machine that I need to copy onto
360K diskettes and transfer onto an MSDOS 3.3 machine.

The file is an .EXE file of about a megabyte in length and is a self-extracting
archive created with PAK.

Naturally, I cannot use 4.01's BACKUP/RESTORE to copy the file over several
disks because 4.01's RESTORE will give an "incorrect DOS version" error when
I try to restore the file to the MSDOS 3.3 machine's hard disk.  I presume
that using MSDOS 3.3's BACKUP/RESTORE will fail for the same or similar
reason.

Upgrading the 3.3 machine to 4.01 is not an option, unfortunately.

What other utility could I use that won't take the DOS version into account?


___________________________________________________________________
                                            _________             /
              Marcus Clenney   ___    ___  /___  ___/ ________   / 
      U. of Central Florida   /   |  /   |    / /    / ______/  /
 Dept. of Computer Science   / /| | / /| |   / /    / /        /
       Orlando, FL  32816   / / | |/ / | |  / /    / /_____   /
 wordproc@bithlo.ucf.edu   /_/  |___/  |_| /_/    /_______/  /
____________________________________________________________/

dmurdoch@watstat.waterloo.edu (Duncan Murdoch) (11/23/89)

In article <1380@ucf-cs.UCF.EDU> wordproc@ucf-cs.UCF.EDU (wordproc) writes:
>Naturally, I cannot use 4.01's BACKUP/RESTORE to copy the file over several
>disks because 4.01's RESTORE will give an "incorrect DOS version" error when
>I try to restore the file to the MSDOS 3.3 machine's hard disk.  I presume
>that using MSDOS 3.3's BACKUP/RESTORE will fail for the same or similar
>reason.

Why not just boot the 3.3 machine from a 4.01 floppy, and use 4.01's restore
there?  You needn't install 4.01 on the disk to be able to run it.

Duncan Murdoch

plim@hpsgpa.HP.COM (Peter Lim) (11/24/89)

Must you use 360K floppy ? May be your 3.3 machine only have 360K
drive. If you have FASTBACK, I am pretty sure it can backup the
file over several disks. Or if you have access to mkstk, the SPLIT
utility can cut your file up into 360K chunks.

Or worse come to worse, you can always write a small utility in C
or Turbo Pascal to read binary file and cut it up; don't forget
to write the utility to put them back together though.

How about this:

/* Should work in principle but might not in practice, and is
   definitely very kludgy. I wrote this right here.
   Therefore I am not responsible for what it does. */

#include <stdio.h>

main() {
FILE	*fp, *fo;
char	name[]="bigfile";
char	oname[200];
int	k,i,f;
int	each=350;		/* each file to be 350 K */

fp = fopen (name, "rb");	/* "b" for binary mode in MSDOS */
for (f=i=k=0; (ch = getc (fp)) != EOF; ) {
	if (k == 0) {
		if (f != 0) {
			fclose (fo);
		}
		sprintf (oname, "file.%d", f);
		fo = fopen (oname, "wb");
	}
	putc (ch, fo);
	i++;
	if (i = 1024) {
		i = 0;
		k++;
	}
	if (k = each) {
		k = 0;
		f++;
	}
}	/* for */
fclose (fp);
fclose (fo);
}

cramer@optilink.UUCP (Clayton Cramer) (11/25/89)

In article <1380@ucf-cs.UCF.EDU>, wordproc@ucf-cs.UCF.EDU (wordproc) writes:
> 
> I have a very large file on my MSDOS 4.01 machine that I need to copy onto
> 360K diskettes and transfer onto an MSDOS 3.3 machine.
> 
> The file is an .EXE file of about a megabyte in length and is a self-extracting
> archive created with PAK.
> 
> Naturally, I cannot use 4.01's BACKUP/RESTORE to copy the file over several
> disks because 4.01's RESTORE will give an "incorrect DOS version" error when
> I try to restore the file to the MSDOS 3.3 machine's hard disk.  I presume
> that using MSDOS 3.3's BACKUP/RESTORE will fail for the same or similar
> reason.
> 
>               Marcus Clenney   ___    ___  /___  ___/ ________   / 

Try this program.  To reconstruct the files, use COPY file1+file2+file3 dest/B.

------
#include <stdio.h>
#include <malloc.h>
#include "std.h"

main(Argc, Argv)

int		Argc;
char*	Argv[];

	{
	long		BytesThisPartFile;
	long		BytesPerPart;
	int			PartNbr;
	char		OutFileName[40];
	FILE*		OutFile;
	FILE*		FileToPart;
	char*		Bytes;
	bool		MoreBytes = TRUE;
	int			BytesRead;
	
	FileToPart = fopen(Argv[1], "rb");
	sscanf(Argv[3], "%ld", &BytesPerPart);
	BytesPerPart *= 1000L;
	Bytes = malloc(1000);
	if((Bytes) && (FileToPart))
		{
		PartNbr = 0;
		sprintf(OutFileName, Argv[2], PartNbr);
		fprintf(stderr, "creating %s\n", OutFileName);
		BytesThisPartFile = 0L;
		OutFile = fopen(OutFileName, "wb");
		if(OutFile)
			{
			while(MoreBytes)
				{
				BytesRead = fread(Bytes, sizeof(char), sizeof(Bytes), 
								  FileToPart);
				fwrite(Bytes, sizeof(char), BytesRead, OutFile);
				BytesThisPartFile += sizeof(Bytes);
				if(feof(FileToPart))
					MoreBytes = FALSE;
				else if(BytesThisPartFile >= BytesPerPart)
					{
					PartNbr++;
					fclose(OutFile);
					sprintf(OutFileName, Argv[2], PartNbr);
					fprintf(stderr, "creating %s\n", OutFileName);
					BytesThisPartFile = 0L;
					OutFile = fopen(OutFileName, "wb");
					}
				}
			}
		fclose(OutFile);
		}
	}
----
-- 
Clayton E. Cramer {pyramid,pixar,tekbspa}!optilink!cramer
My definition of social justice: those who refuse to work deserve to go hungry.
===============================================================================
Disclaimer?  You must be kidding!  No company would hold opinions like mine!