Roadmap96: MAP15 - FTPmail | WebReference

Roadmap96: MAP15 - FTPmail

Roadmap96

RM 01 02 03 04 05 06 07 08 09 10
11 12 13 14 15 16 17 -B 18 19 20
21 22 23 24 25 XT XT 26 XT 27   

MAP15: FTPMAIL

"The whole of science is nothing more than a refinement of everyday thinking."
-- Albert Einstein, Out of My Later Years

Before we get to FTPmail, there are a few other things I want to discuss.

In MAP14 I showed you how to retrieve a text file using FTP. But how can a text file written on an IBM be read on an Apple Macintosh or on a Unix workstation? It is easy, thanks to something called ASCII.

ASCII is the American Standard Code for Information Interchange, and it is the standard format for transmitting textual data. *Any* computer can read an ASCII file. Without going into too much detail about how ASCII works, let's just say that ASCII ensures that the text in an ASCII file will appear the same on any computer regardless of the computer's brand name or operating system.

ASCII is fine and dandy for saving and transferring text files, but it will not work with non-text, data files -- such as computer programs. Data files must be saved in "Binary" (which is just a bunch of zeros and ones).

Binary files can run on certain machines or programs. Good examples of Binary files include shareware software, Microsoft Word files, Microsoft Powerpoint presentations, satellite weather images, and sound files.

Remember, ASCII files are just 'plain' text files that can be read on any computer, and Binary files are program files that can be run only on certain computers.

Unfortunately, there is no universal default transfer mode for FTP clients. Some clients use ASCII as the default, and others use Binary. This means that unless you tell your FTP client to do otherwise, all of your files will be transferred in the default transfer mode.

If your client's default transfer mode is ASCII and you try to retrieve a Binary file without first resetting the transfer mode, your Binary file will be transferred in ASCII and the file *WILL NOT WORK* once you get it.

Fortunately, changing the transfer mode in FTP is easy. All that most of you have to do to change the FTP transfer mode from ASCII to Binary is type

binary

right before you get the file, and the file will be transferred to you in Binary format.

To change back to ASCII transfer mode, just type

ascii

and FTP will reset its transfer mode to ASCII.

If you ever forget what transfer mode you are currently using -- something that I do *ALL* the time -- all you need to do is type

status

and your computer will display a whole bunch of information, including your transfer mode. :)

BTW, how can you tell if a file is an ASCII file or a Binary file? Well, take a look at the extensions (remember, an extension is the stuff at the end of the file name -- the extension for CRISPEN.DOC is .DOC; the extension for SQUIRREL.TXT is .TXT). If the file's extension is .doc or .txt, or if the file does not have an extension, it is a good bet that the file is an ASCII text file. If the file has a weird extension -- like .gif or .zip -- it is a good bet that the file is a Binary file. There are, of course, always exceptions to this rule.

The "duck theory" also works pretty well in determining if a file is an ASCII or Binary file. The duck theory says that if it looks like a duck, waddles like a duck, swims like a duck, quacks like a duck, and is seen hanging around with other ducks ... it probably is a duck.

Using the duck theory to determine if a file is an ASCII or Binary file, you can safely assume that if you have a file that looks like an ASCII file and is seen in the same directory as other ASCII files, you can safely assume that the file that you are looking at is, in reality, a DUCK! :)

(First squirrels ... now ducks ... this workshop is getting to me.)

 

MULTIPLE FILE TRANSFERS

How can you transfer multiple files at the same time? Simple! Use the "mget" (multiple get) command!

Let's say that I want to get every file in a particular directory that begins with the word "duck.". I would type

mget duck*

The "*" (a.k.a. "splat") is a "wild card" that tells the client to get every file that begins with the word "duck" and that has any additional characters after the word "duck".

The best way to explain wildcards is to give you an example. Let's pretend that I have a directory with the following files in it:

     duckreport.doc     ducket.exe        duck1.txt
     duck2.txt          ducksoup          duck.gif

Where I place the wildcard in my "mget" command will determine what files I get.

     mget command      files it would retrieve
     ------------      -----------------------
 
     mget duck*        duckreport.doc; ducket.exe; duck1.txt; 
                       duck2.txt; ducksoup; duck.gif
     mget duck*.txt    duck1.txt; duck2.txt
     mget duck.*       duck.gif

Before you continue on, take a minute and try to figure out why the different "mget" commands retrieved different files. If you can figure it out -- and believe me folks, this is EASY -- you will be a master of the "mget" command. :)

 

FTPMAIL

If your local Internet service provider does not have an FTP client, you can still get FTP files by using a tool called FTPmail!

The steps in a basic FTPmail session are pretty easy:

  1. Write an e-mail letter to an FTPmail site near you, and put the necessary FTPmail commands in the BODY of your letter.
  2. The FTPmail site will write you back and tell you that it has received your request, and will tell you the number of requests ahead of yours (I still think the number that they give you is just a random, large number -- but I am probably mistaken).
  3. A day or two later -- yes, I said "day" -- the FTPmail system will e-mail to you the file that you requested. The FTPmail system will also send you a copy of the "transaction" as it occurred between FTPmail and the remote FTP site. This transaction will look a lot like the examples in MAP14.

Today, I am going to show you how to get ASCII files using FTPmail. We will talk about Binary files tomorrow.

The first step is finding an FTPmail site near you. FTPmail was developed at the Digital Western Research Laboratory, and their FTPmail address

[email protected]

is the most widely known (and widely used) FTPmail address in the world. Unfortunately, because of the traffic that this site sees, the "decwrl" address is also sometimes the slowest FTPmail site in the world. :( <--- a frowning smiley (although I guess it would be easier to call that a "frownie").

There are other FTPmail servers around the world that may be closer to you, and that may actually be faster than the "decwrl" address. The following list of FTPmail servers is courtesy of a good friend of mine, Dr. Bob Rankin. Doctor Bob is the author of "The Whole Internet ... By E-mail!", and is also my "partner in crime" on the TOURBUS list (we'll talk about both the guide and TOURBUS during the last part of the workshop).

Keep in mind that FTPmail servers come and go every day. It is highly likely that some of these FTPmail addresses may no longer be responding. If that is the case, just try another address. :)

   [email protected]                           (Argentina only)
   [email protected]                        (Australia only)
   [email protected]                             (Germany)
   [email protected]                 (Germany - OUT OF 
                                                SERVICE?)
   [email protected]                            (Ireland)
   [email protected]                         (Poland)
   [email protected]                      (Portugal only)
   [email protected]                        (South Africa)
   [email protected]                         (Sweden)
   [email protected]                          (Sweden)
   [email protected]                      (Taiwan)
   [email protected]                      (United States)
   [email protected]                      (United States)
   [email protected]                       (United States)
   [email protected]                    (United States)
   [email protected]                    (United States)
   [email protected]                           (United States)
   [email protected]                       (United States)
   [email protected]                     (United Kingdom)

Once you have found the site closest to you, you are ready to start sending commands to the FTPmail address! The commands, just like all of the LISTSERV commands that I drilled into your head earlier in the workshop, need to be in the BODY of your e-mail letter.

The body of your letter to the FTPmail site will actually have SEVERAL commands in it. The basic FTPmail commands are, in order:

     reply <your Internet address>       This tells FTPmail where to 
                                         send the file(s).
 
     connect <FTP site address>          This tells FTPmail the site 
                                         that you want it to connect 
                                         to.
 
     <transfer mode>                     This tells FTPmail if you 
                                         want the files in ASCII or 
                                         Binary.
 
     chdir <directory>                   This tells FTPmail in which 
                                         directory the file that you 
                                         want is located.
 
     get <filename>                      This tells FTPmail to get a 
                                         specific file.
 
     quit                                Ends the FTPmail session.

In MAP14, we FTP'd to "rs.internic.net", got into the "/internic/faq" directory, and got the file "roadmap.faq" -- or, in URL format, we retrieved the file

ftp://rs.internic.net/internic/faq/roadmap.faq

To do this using FTPmail, I need to send an e-mail letter to

[email protected]

(or to any other FTPmail site), and the body of my letter would look like thi

          reply [email protected]
          connect rs.internic.net
          ascii
          chdir /internic/faq
          get roadmap.faq
          quit

NOTE: IF YOU SEND THIS EXAMPLE TO AN FTPMAIL SITE WITHOUT CHANGING THE REPLY-TO ADDRESS, THE FTPMAIL SITE WILL SEND THE FILE TO *ME*, NOT TO YOU. PLEASE CHANGE THE "REPLY" LINE ADDRESS SO THAT IT HAS YOUR ADDRESS IN IT, NOT MINE ... PLEASE ... PRETTY PLEASE ... PRETTY PLEASE WITH A SQUIRREL ON TOP ... :)

A day or two after I send this letter to the FTPmail address, I should see the file sitting in my e-mail box. Notice that I said "should." The traffic at the various FTPmail sites is often quite incredible, and sometimes requests are lost. If this happens to you, just send your request again.

By the way, the "dir" command works just as well in FTPmail as it does in regular FTP! All you have to do is add the command "dir" after the "chdir" command:

          reply [email protected]
          connect rs.internic.net
          ascii
          chdir /internic/faq
          dir
          quit

 

HOMEWORK:

1). If you do not have FTP access through your local Internet Service Provider,

 

2). If you *do* have FTP access through your local Internet service provider, make sure that you:


Start Lesson Sixteen | Go to the Roadmap96 Syllabus | Go to the Roadmap96 Homepage


Originally written by Patrick Douglas Crispen