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 that I want to discuss. Yesterday 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? Its 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 text file. Without going too in-depth into how ASCII works, let's just say that ASCII ensures that the text in an ASCII text 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 won't work with non-text, data files -- like computer programs. Data files must be saved in "Binary" (which is just a bunch of zeros and ones). Binary files are files that can only 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 files that can only be run on certain computers or programs. 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* of 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 is probably 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 a ASCII text file and is seen in the same directory as other ASCII text 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 with the word "duck" in it. 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 each of the 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 that 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 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 yesterday's lesson). Today, I am going to show you how to get ASCII text files using FTPmail. We'll 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 -- ftpmail@decwrl.dec.com -- 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 There are other FTPmail servers around the world that may be closer to you, and that may actually be faster that the decwrl address: Australia ftpmail@cs.uow.edu.au France ftpmail@grasp.insa-lyon.fr Germany ftpmail@ftp.uni-stuttgart.de Great Britain ftpmail@doc.ic.ac.uk Ireland ftpmail@ieunet.ie Sweden ftpmail@lth.se USA ftpmail@sunsite.unc.edu USA ftpmail@ftp.uu.net USA ftpmail@decwrl.dec.com Once you have found a 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 you letter to the FTPmail site will actually have SEVERAL commands in it. The basic FTPmail commands are, in order: reply This tells FTPmail where to send the file(s) to. connect This tells FTPmail the site that you want it to connect to. This tells FTPmail if you want the files in ASCII or binary chdir This tells FTPmail in which directory the file that we want is located. get This tells FTPmail to get a specific file. quit Ends the FTPmail session Yesterday, we ftp'd to ftp.sura.net, got into the /pub/articles directory, and got the file fall91.issue To do this using FTPmail, I need to send an e-mail a letter to ftpmail@sunsite.unc.edu (or to any other FTPmail site), and the body of my letter would look like this: reply pcrispe1@ua1vm.ua.edu connect ftp.sura.net ascii chdir /pub/articles get fall91.issue quit NOTE: IF YOU SEND THIS 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 TO ADDRESS :) 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 incredible, and sometimes requests get lost. If this happens to you, you should 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 pcrispe1@ua1vm.ua.edu connect ftp.sura.net ascii chdir /pub/articles dir quit TOMORROW: - FTP File Compression/Decompression - Binary files via FTPmail - A few more FTPmail commands (i.e. chunksize). HOMEWORK: 1. If you do not have FTP access through your local Internet service provider, a. find the address of the nearest FTPmail site from the list above b. send a letter to that FTPmail site with the word HELP in the body of your letter c. ask your local Internet service provider if they have any size limits on messages to and from the Internet. 2. If you *do* have FTP access through your local Internet service provider, make sure that you a. know how to access your FTP client b. know the commands that your client allows c. review MAP13 and MAP14 PATRICK DOUGLAS CRISPEN THE VIEWS EXPRESSED IN THIS LETTER DO NOT PCRISPE1@UA1VM.UA.EDU NECESSARILY REPRESENT THE VIEWS OF THE THE UNIVERSITY OF ALABAMA UNIVERSITY OF ALABAMA - TUSCALOOSA ROADMAP: COPYRIGHT PATRICK CRISPEN 1994. ALL RIGHTS RESERVED.