[comp.binaries.ibm.pc.d] Getting files from c.b.i.p

granger@cg-atla.UUCP (Pete Granger) (07/28/89)

Maybe I shouldn't be doing this, because my ways for doing things may not work
for everyone. But this should give people a little help, at least, with getting
these files to their PC's. Anything I say is just based on my own experience,
on a VAX running Ultrix.

The binaries in comp.binaries.ibm.pc have been zoo'ed, uploaded, uuencoded,
split up, and posted. You just have to reverse the process.

1) Get each of the parts saved from news onto your unix machine. This is
   usually best done with the 'w' command while you're looking at the article.
   Each article should have a part number in the subject line, and it is
   helpful to use that number in the filename that you save to. For example,
   the six parts of the "foo" program would be foo01 through foo06. Be
   careful: the parts don't always appear in the right order, so check that
   subject line. (This undoes the "posted" part.)

2) Copy the first file to another name, and save the summary that appears
   at the top of the file. This is optional, but you'll probably want it
   later.

3) Strip off the additional information in the file. This is done by deleting
   the "cut here" lines and everything above and below them. In the first file,
   you will be deleting everything above the "begin 644 foo.zoo" line. In the
   last file, you will be deleting everything below the "end" line. All of the
   strange looking stuff that you are leaving is uuencoded data (We'll get to
   that later). Now "cat" all of the files, in order, into another file, such
   as "cat foo01 foo02 foo03 foo04 foo05 foo06 > foo.all". Wild cards are
   allowed, of course. Do *not* cat them into foo.zoo, since that may be
   reserved for the uudecode output. (This undoes the "split up" part.)

   If you'd rather not do this by hand, you can use the "combine" script
   below (I forget who posted it, but thanks!). Just say
   "combine foo01 ... foo06" or whatever is appropriate to the files you've
   saved. Make sure you give all the parts, in order. Wild cards also work,
   so you could say "combine foo0*" or whatever you need to distinguish the
   files you want combined. You'll get a file with the ".zoo" suffix, which
   is what you need. (This undoes the "split up" and "uuencoded" parts. You
   can skip to step 5.)

#! /bin/sh
# This is the comp.binaries.ibm.pc script called "combine".
# It concatenates and uudecodes the important parts of files from
# comp.binaries.ibm.pc.
cat $* | sed '/^END/,/^BEGIN/d'| uudecode

4) If you're reading this, you must not be using the script. After step (3),
   you now have your foo.all file, which is a uuencoded version of the
   zoo archive. Just say "uudecode foo.all" and uudecode will create a
   file with the ".zoo" suffix, which is what you need for your PC. (This
   undoes the "uuencoded" part.)

5) Verify that the zoo archive is okay. In the summary that is included in
   the first file of any binary, the file size and a checksum are given
   for the .zoo file. These can be checked by running "sum" on the file
   and checking its size. Both are done with the script below. There is
   also something called "brik" which can be used to verify checksums (it's
   also mentioned in the file header), but I don't have it myself. "sumsize"
   has always worked fine for me.

# Gives the checksum and filesize for comparison with the moderator's notes
# in comp.binaries.ibm.pc
#
sum $1
wc $1

5) Download the file to your PC. I use kermit in binary mode, but other
   protocols should work just as well. Just remember that it has to be
   binary mode. (This undoes the "uploaded" part.)

6) Now you need the ZOO executable on your PC. A new version of this was
   posted just a short time ago, so everyone should be able to get it. (As
   an aside, I think it should be posted regularly, perhaps every month,
   so that new users can get it when they need it.) First you'll want to
   run "zoo -t foo.zoo". The -t option tests the file for integrity. If
   you get errors, you should probably go back to step (5). If it tests out
   okay, then run "zoo -extract foo.zoo" and all the files will be extracted
   from the archive. Note that there is a shorter version of the -extract
   option, but I can never remember what it is. It's given in zoo.man, though.
   (This undoes the "zoo'ed" part.)

7) At this point, you should have the file(s) as it was created on the PC,
   and you can use it normally.

Hope that this helps a few people, and that I didn't step on anyone else's
jurisdiction.
-- 
Pete Granger    ...!{ulowell,ginosko,decvax,ism780c,ima}!cg-atla!granger
   "The tab, is there, to open the can.
    The can, is there, to hold in the Spam."
                                             - Weird Al Yankovic, "Spam"

davis@ux3 (Jeffrey Davis) (07/29/89)

Another way (if you don't mind the larger files) is to 
o  write all of the parts to the same file from within 
   news.
o  transfer those files to your machine
o  use a UUdecode program for the IBM.  
	
The advantages are:
You don't have to deal with file protection and ownership on the 
unix system (if that is one of your problems), binary file 
transfers, and taking out the ----cut----here--- stuff.
I use QUUDCD 2.1 Theodore Kaldis and it has proved reliable.
The big disadvantage is that the files are about 50% larger
when uuencoded.  
-- 
Jeff Davis (JCDavis@lbl.gov)

keithe@tekgvs.LABS.TEK.COM (Keith Ericson) (08/01/89)

In article <7479@cg-atla.UUCP> granger@cg-atla.UUCP (Pete Granger) writes:
>Maybe I shouldn't be doing this, because my ways for doing things may not work
>for everyone.

My scheme may not work for everyone, either, but here's how I"ve
semi-automated my work of saving CBIP postings.

I use rn running on a BSD 4.2 machine to read news.  The salient
point here is that it allows the current article to be piped out to
a subordinate process " | <whatever>."

So I've developed a KORN shell script (included below) I call nwr
("News WRite") to simplify saving multiple-part CBIP postings.  It
is used in two modes: first-article-mode and subsequent-article(s)-mode.

When the first of a series of articles appears I want to save I tye
in 
	| nwr <full-path-name-of-file-to-be-saved>

such as

	| nwr ibm.dir/editors/vi.dir/part1

If the directory specified does not exist you will be prompted to
either have it created, or enter a new name, or to exit.  This helps
insure you get the file where you want it and not where your fingers
may have mistakenly told it to go :-)

Subsequent articles can then be saved by providing only the file-name
portion of the path, such as

	| nwr part2

and nwr will provide the basename (as it's called) for you.  The
most recently entered basename is stored away in a file in your
$HOME directory.  (By the way - does anyone know how to store this
information in an environmental variable instead of saving it away
in a file?)

I find this tool saves me a lot of work - I stash away almost
everything Rahul distributes - and particularly alleviates the typo
errors in trying to save the articles away.

Once I have all the parts saved away I either cat them all through a
filter (implemented with a KSH alias) I call "udec" (also included below)
or I access them via PC-NFS and use Richard Marx's (excellent) uudecode
program on them.

Hope these scripts are of some use.  Remember, "nwr" is a KORN shell
script - I think it won't work with a Bourne shell (sorry).  And "udec"
is a (KSH?) alias.

kEITHe

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

BEGIN nwr:



#!/usr/tools/bin/ksh
# replace with the path to your ksh if the above isn't correct
NEWDIR=0
NEWFILE=0

# script to use within rn to save keystrokes while saving
#   multiple-part articles.  This remembers the directory
#   name in $HOME/.nwrsavedir for automatic retrieval.

case $# in

	1)	DESTDIR=${1%"`basename $1`"}
		if	[ "$DESTDIR" = "" ]
		then	DESTFILE=${1}
			read DESTDIR < $HOME/.nwrsavedir
		else	DESTFILE=`basename ${1}`
			print "${DESTDIR}" > $HOME/.nwrsavedir
		fi
		;;

	*)	echo "usage: nwr [destdir-path/]destfile"
       		exit
	        ;;

esac

print DESTDIR = ${DESTDIR%"/"}
print DESTFILE = $DESTFILE

while [ $NEWDIR = 0 ]
do
	if	test -d ${DESTDIR%"/"} 
	then	NEWDIR=1
	else	read ans?"${DESTDIR} does not exist: create, new name or exit (c/n/e)?" < /dev/tty
		case $ans in 
		c|C)	mkdir ${DESTDIR%"/"}
			if $?
			then	print "${DESTDIR%"/"} created"
			else	print "Cannot create ${DESTDIR%"/"}"
			fi
			;;
		n|N)	read DESTDIR?"input new directory name: " < /dev/tty
			print "${DESTDIR}" > $HOME/.nwrsavedir
			;;
		e|E)	exit;;
		*)	print "Huh?"
			;;
		esac
	fi
done

while [ $NEWFILE = 0 ]
do
	if	[ -f "${DESTDIR}${DESTFILE}" ]
        then	read ans?"${DESTFILE} exists: replace, append or new name (r/a/n)?" < /dev/tty
	        case $ans in
			r|R)	print "replacing ${DESTDIR}${DESTFILE} with this article"
				cat <&0 > ${DESTDIR}${DESTFILE}
				NEWFILE=1
				;;
	
			a|a)	print "appending this article to ${DESTDIR}${DESTFILE}"
				cat <&0 >> ${DESTDIR}${DESTFILE}
				NEWFILE=1
				;;
	
			n|N)	read DESTFILE?"input new file name" < /dev/tty
				;;
		esac
	else	print "saving current article to ${DESTDIR}${DESTFILE}"
		cat <&0 > ${DESTDIR}${DESTFILE}
		NEWFILE=1
	fi
done
set +x

END nwr
===========================================================================

BEGIN udec

alias udec="sed '/^END-/,/^BEGIN-/d'| uudecode"

END udec

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