Date: 28 Nov 1994 02:31:33 GMT
From: carpenterv@vms.csd.mu.edu (CBIP Moderator)
Newsgroups: comp.binaries.ibm.pc
Subject: Beginner's Guide to Binaries V1.5 (part 01/01)

checksum: 1551014491 (Verify with "brik -cv")
Submitted-by: carpenterv@vms.csd.mu.edu
Posting-number: Volume 27, Issue inf02
Archive-name: admin/bin.man

[Date of last change 29-Nov-94]

                HOW TO USE BINARIES SENT VIA NEWS AND E-MAIL

    (c) Copyright 1994 Brian  O'Neill.   Permission  to distrbute this file
    freely is granted, so long as it remains unmodified.

    One of the more troubling things to  new users is using programs posted
    to  groups like comp.binaries.ibm.pc.  This is in part due to the  fact
    that different utilties are needed to decode these files into something
    more familiar to them.  This manual explains  how  to  retrieve  binary
    files posted to UseNet, and also received by e-mail.

    This manual is  divided  into  several  sections,  each  dealing with a
    different aspect of what is needed.  Here is the basic setup:

        I.      Formats and Standards
        II.     Minimum utilities, and how to get them
        III.    Using UNIX to do the work
        IV.     Using MS-DOS to do the work
        V.      Handling archived files
        VI.     Downloading files from UNIX to MSDOS

 
                    I. FORMATS AND STANDARDS

    UseNet, and other networks, user  groups,  and  BBS's, all work on some
    set  of  standards  for sharing files between a diverse  arangement  of
    systems.  For PC's, the most common standard for files is the  archive.
    This  is  a binary file which allows a user to place several files into
    one, while compressing them to save space.  Several utilities exist for
    making and extracting files  from  archives.   The  most common are ZOO
    from  Rahul  Dhesi, and PKZIP from PKWare.  The ZIP standard  has  been
    adopted for use in the UseNet newsgroup  comp.binaries.ibm.pc  for  the
    distribution.   Some  BBS  systems use ZIP, and others use ARC, another
    format from System  Enhancement  Associates  which  is  slowly becoming
    obsolete,  and  is generally avoided due to recent litigation in  court
    (which I will  not  discuss  here).   You  will  need  the  appropriate
    extraction  program  for  the  particular  format you are dealing with,
    which usually can be told  by  the  extension  name  on the file (.ZOO,
    .ZIP, or .ARC).

    UseNet and e-mail are based on  ASCII  text.   In other words, they are
    only  able to transmit ASCII files.  In order to transmit binary files,
    they are transformed into ASCII  files  first.   This  is  accomplished
    using a program called 'uuencode', another fairly common standard.  The
    file can then be decoded back into binary form using 'uudecode'.  These
    programs  are  fairly  common  among UNIX systems, and are increasingly
    available for MS-DOS.  Once again, you  will need a version of uudecode
    to properly handle these files.
 
              II. MINIMUM UTILITIES, AND HOW TO GET THEM

    You will need some form of  uudecode,  either UNIX or MS-DOS, to decode
    the  binaries.   If  you do not have it for either of these,  you  must
    secure a copy of the source code.  If you have FTP access, you can  get
    MS-DOS       source      code      from      oak.oakland.edu      (File
    pub/msdos/starter/uudecode.pas).  If not, you will  have to get it from
    someone else.

    Also, you need an  archive  extractor.  Small extract-only programs are
    available,  such  as BOOZ by Rahul Dhesi.  It will be assumed  you  can
    secure one of these without problem, as with uudecode.

    Also available is  the  CBIP  Starter's  Kit,  which  contains  a small
    version  of  uudecode  and  a  uuencoded version  of  UNZIP  (ZIP  file
    extractor), and instructions on how to make use of these  files.   This
    is  enough  to get you started in dealing with the comp.binaries.ibm.pc
    newsgroup on UseNet.

 
                  III. USING UNIX TO DO THE WORK

    UseNet is  a  network  comprising  mostly  of  UNIX-based  machines, so
    therefor it is quite common to use the system connected to UseNet to do
    most  of  the work, rather than downloading from that system and  doing
    all the work on a PC.  To do this, you will need  the  following  basic
    utilities:

                        uudecode
                        editor (vi, emacs, etc.)
                        cat (not necessary, but useful)
                        combine (Also not necessary, but makes
                                 everything easy)

    The first thing you must do is use your news reader program to save the
    articles to files.  If the uuencoded  file spans more than one article,
    save  then to different articles.  Check your manual pages for the news
    reader you have for details.  If you are using 'rn', do the following:

    From within the  article,  or  at  the  end  of  the  article,  type 'w
    filename'.   Answer  'n'  to  the mailbox  format  question,  and  then
    continue.  's filename' could also be used,  but  it  saves  additional
    header  information that is not needed, and would have to be edited out
    anyway.

    For one single file,  things  are  easy.   Use your favorite editor and
    delete all lines before the 'begin' line, and all lines after the 'end'
    line.   Then you can give the command 'uudecode file', and the new file
    will be created for you.  Download the new file to your PC.

    For multiple files,  you  must  edit  each  file.   For the first file,
    delete  all lines before the 'begin', and go to the end of the file.  A
    line of uuencoded text looks like this:

M'YV01N2\:0-BSAPV:<Z4D0-B2ATW((+`80AB!@@8.73`F*$Q!X@8.7#@4""E

    You then must delete  any  lines  after  the last uuencoded line.  Then
    proceed to the remaining files, deleting all lines before and after the
    uuencoded  lines.   When  you come to the last file, delete  all  lines
    after the 'end' line.  Save each file after it has been edited.

    Now, to decode them, give the following:

        cat file1 file2 file3 ... | uudecode

    Users of csh can use range  specifiers  to simplify the typing, such as
    if you have a five part file, you can say:

                cat file[1-5] | uudecode

    This will create a file  specified  in  the  begin  line.  Then you can
    download this file to your PC.

 
                    IV. USING A PC TO DO THE WORK

    There are several versions of UUDECODE  for MS-DOS available.  You need
    some  version of UUDECODE to proceed.  Check the local archives, or the
    CBIP Starter's Kit.

    After dowloading the files to the  PC,  edit  out unwanted lines in the
    file.  If using a simple version of UUDECODE, concatenate all the files
    into one large file.  Then type:

                uudecode <filename>

    You should then end  up  with  the  program  you  went  through all the
    trouble for.
 
                     V. HANDLING ARCHIVE FILES

    An archive is simply a  file  containing  several other files.  Usually
    these other files are compressed in some fashion, in order to save disk
    space.   These files are used generally for easier handling of  several
    files.  There are many types currently  in  existence,  such  as  .ARC,
    .ZOO,  and  .ZIP.  The instructions below can be used for most any type
    of archive, using the appropriate programs.

    To extract  files  from  an  ZIP  file,  you  must  have  some  sort of
    extractor.   Info-ZIP's  UNZIP (to be included in Starter's Kit) is  an
    extract-only program for dealing with ZIP files.  To unpack  an  entire
    archive, simply type the following:

                        unzip <archive>

    This will unpack the entire  contents  into the current directory.  You
    need  not  specify  the .ZIP extension.  To extract  particular  files,
    simply specify the filename after the archive name.

 
             VI. DOWNLOADING FILES FROM UNIX TO MSDOS

   To download the files, you will need the following:

        1) A file transfer protocol on your UNIX system (i.e. Kermit,
           Xmodem, Zmodem, etc.)

        2) A PC communications package that supports the same protocol

    Due to  the  large  amount  of  protocols  and  communications packages
    available,  it  would  be next to impossible to describe all  of  them.
    choosing the proper set up  often  depends  on  your  situation.   Some
    protocols  are  much  faster  than others, yet cannot be used over some
    networks.  For the  purposes  of  examples,  I  will  use Kermit as the
    protocol  (specifically  C-Kermit), and ProComm as  the  communications
    package, as they are in wide use and very reliable over most  networks.
    A  more generic method for downloading follows afterwards, but you must
    read the manuals to all programs to operate them properly.

    First off is  to  determine  what  type  of  file  you are downloading,
    whether  it  is  binary or ASCII.  Usually, if you can  read  it,  it's
    ASCII.  Files with extensions EXE, COM, and archive files such  as  ZIP
    are almost always binary.  On UNIX, you can say:

                file <filename>

    this will usually tell you what type of file it is.

    Downloading ASCII text is easy.  On UNIX type:

                kermit -s <filename>

    the "-s" puts  C-Kermit  into  "send"  mode.   You  then  instruct your
    terminal  program to receive a Kermit transfer.  On ProComm, you  would
    hit PgDn, and then select Kermit off the menu,  selection  2.   ProComm
    will take care of the rest, and you can watch it's progress.  When it's
    done, ProComm will return you to UNIX.

    Downloading binary files are a little  more difficult.  If you can dial
    in  to  a UNIX host using 8-bit communications (such as 8-N-1), do  so.
    Sometimes the Login: prompt may look weird, but once the host knows, it
    will fix itself.  If you cannot use 8-bit settings (the host insists on
    7 bits to be readable), you may wish to transform the binary file  into
    ASCII,  using  the  uuencode program, downloading as above for normally
    ASCII files, and uudecoding the file on the PC.

    If you are able to use 8 bits, on UNIX type:

                kermit -is <filename>

    the "-is" puts C-Kermit into  "send,  image" mode.  Basically, "tell it
    like it is".  As above, hit PgDn, then 2 and ProComm will do the rest.

    For a more generic explanation of  what  to  do, here is a step-by-step
    version of the above, without specifics:

        1) Determine what type the file is (ASCII or binary)

        2) Initiate transfer on UNIX end. Usually accomplished by executing
        a program and giving the filename of what you wish to download. If
        it is a binary file, specify 'binary' or 'image' mode, usually as a
        switch on the command line.

        3) Escape back to the PC, and set for receiving a file using the
        same protocol as being sent with. Often done by hitting some Hot Key
        (usually Pg-Dn), and then specifying the protocol you are using.

    You really should read the manuals to  any programs you wish to use for
    downloading files.  Programs change, and they are not all used the same
    way.  If you can't seem to get a program to work, consult someone using
    the same programs, and see what it might be that you do differently.

--
Vinit S. Carpenter        Marquette University      carpenterv@vms.csd.mu.edu
     Author of the INTERNET-MENU for OpenVMS and LEARN C/C++ TODAY List
                          * Email me for details *
     <a href="http://vinny.csd.mu.edu"> My Personal Linux Web Server</a>
