[comp.sys.att] DSPLIT - splitting files over multiple floppies

cmv@cbnewsc.ATT.COM (C M Votava) (08/31/89)

I posted the source for this program a while ago in unix-pc.sources, and
didn't get any response. I suspect the article may have had some trouble
getting out to the net. So I'm re-posting the announcement here, and if
I get enough interest from folks wanting a copy, I'll try to re-post the
source again.

===========================================================================

Have you ever wished for a program that would break up big files and write
them to multiple floppies in a single stroke? Don't you *HATE* to sit there
and feed floppies to your unixpc all day just to back up the silly hard
disk? Well maybe this little program that I have can help you out some.

I have a program called dsplit (for device split). It takes standard input
and writes to the floppy; when the floppy is full, it prompts you for another
floppy, and continues on (similar to the unixpc "cpio" command) until you're
finished. I've written it on and for the unixpc, but it should compile on
other machines without much trouble.

Let's say you have a file that's too big for a single floppy. To save it
over multiple floppies you type:

	$ cat file | dsplit -o

To read it back in from those floppies you type:

	$ dsplit -i >file

This is particularly useful when trying to back up files on the unixpc.
When you think about it, many times this is what you want to do:

	$ find / -print | cpio -ocv | compress -c >/dev/rfp021

The problem with this is that you can't do this over more than one floppy.
Here's how it works with dsplit:

	$ find / -print | cpio -ocv | compress -c | dsplit -o

This will backup your entire hard disk to less than (almost half) the number
of floppies it normally would. To retrieve your files, type:

	$ dsplit -i | uncompress -c | cpio -icdv

Well, you get the idea. Let me know how you like it, and different ways
you've learned to use it.

Have fun...

-Craig Votava

[att!]ihlpz!cmv
[att!]ihlpm!cmv

===========================================================================

If you want a copy, please mail me at any of the above addresses.

-Craig

vince@tc.fluke.COM (Craig Johnson) (09/08/89)

In article <2842@cbnewsc.ATT.COM>, cmv@cbnewsc.ATT.COM (C M Votava) writes:
> I posted the source for this program a while ago in unix-pc.sources, and
> didn't get any response. I suspect the article may have had some trouble
> getting out to the net. So I'm re-posting the announcement here, and if
> I get enough interest from folks wanting a copy, I'll try to re-post the
> source again.
> ===========================================================================
> Have you ever wished for a program that would break up big files and write
> them to multiple floppies in a single stroke? Don't you *HATE* to sit there
> and feed floppies to your unixpc all day just to back up the silly hard
> disk? Well maybe this little program that I have can help you out some.
> 
> I have a program called dsplit (for device split). It takes standard input
> and writes to the floppy; when the floppy is full, it prompts you for another
> floppy, and continues on (similar to the unixpc "cpio" command) until you're
> finished. I've written it on and for the unixpc, but it should compile on
> other machines without much trouble.

Craig Votava's dsplit sounded vaguely familiar to me, so a scrounged
around a bit and found the following two scripts which were first posted
by Corey Satten four years ago.  These should perform the same functions
as dsplit.  Give them a try and see how you like them.

----------------------------- Shar archive follows ------------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by fluke!vince on Thu Sep  7 16:25:24 PDT 1989
# Contents:  fread fwrite
 
echo x - fread
sed 's/^@//' > "fread" <<'@//E*O*F fread//'
: '  
:  Read as many Unix-PC floppy disks to standard output as are needed
:  to satisfy the program reading them. (such as tar or cpio.)
:
:  Sample usage: fread | uncompress | tar xvf -
:
:  Author: Corey Satten, fluke!corey Aug. 1985
:  This software is hereby declared totally public domain.
: '
trap "/etc/dismount -f 2>/dev/null 1>&2; exit 0" 0
trap "/etc/dismount -f 1>&2; exit 1" 1 2 13 15
diskno=1
while dd if=/dev/rfp021 ibs=4096 count=79 2>/dev/null ;do
    /etc/dismount -f 1>&2
    diskno=`expr $diskno + 1`   
    echo "To EXIT -- press <E> followed by <RETURN>." 1>&2
    echo "To continue - insert floppy disk #$diskno and press the <RETURN> key." 1>&2
    choice=`head -1 </dev/tty`
    case "$choice" in
	E*|e*) exit 1;;
    esac
done
@//E*O*F fread//
chmod u=rw,g=rw,o=rw fread
 
echo x - fwrite
sed 's/^@//' > "fwrite" <<'@//E*O*F fwrite//'
: '  
:  Copy standard input onto as many Unix-PC floppy disks as needed,
:  buffering appropriately, and prompting the user to change as necessary.
:
:  Sample usage: tar cvf - . | compress | fwrite
:
:  Author: Corey Satten, fluke!corey Aug. 1985
:  This software is hereby declared totally public domain.
: '

trap "/etc/dismount -f 1>&2; exit 1" 1 2 13 15
diskno=1
go=true
while $go ;do
    set `dd of=/dev/rfp021 obs=4096 count=632 2>&1`
    if test $1 = 632+0 ;then
	/etc/dismount -f 1>&2
	diskno=`expr $diskno + 1`   
	echo "To EXIT -- press <E> followed by <RETURN>." 1>&2
	echo "To continue - insert floppy disk #$diskno and press the <RETURN> key." 1>&2
	choice=`head -1 </dev/tty`
	case "$choice" in
	    E*|e*) exit 1;;
	esac
    else
	/etc/dismount -f 2>/dev/null 1>&2
	go=false
    fi
done
@//E*O*F fwrite//
chmod u=rw,g=rw,o=rw fwrite
 
exit 0
------------------------------ End of shar archive --------------------------

By the way, Corey can no longer be reached at the enclosed address.  If
anyone wishes to correspond with him contact me and I'll be glad to give
you his new address.

	Craig V. Johnson		...!fluke!vince
	John Fluke Mfg. Co.
	Everett, WA