Moving Files

between your computer and

[ this writeup was done for a computer named Please read "" wherever you see "vlacc" references  9/7/01 ]

Moving a file from your computer to rexx, or vice versa, is something you may want to do sometime. First, let's talk about whether or why you'd want to do it. Second, let's talk about how it could be done. I assume you use a Windows computer, and run a telnet utility on it in order to get connected and conduct sessions on

Can't we just do it in telnet?

First of all, when you run your telnet program, you are single-mindedly seeking to be able to pretend from afar that you are seated at the computer, and do exactly what you'd do if you were there. The telnet program is the magic agent that let's you simulate being at rexx. Another way to say it is that, by transforming yourself into a user of rexx, you are temporarily setting aside your role as the user of your own computer. It becomes incidental to your activity on rexx once you're connected. You turn your back on your machine, and face rexx instead. Except for the components of your computer that are directly supporting the rexx connection, you do not use your computer while connected to rexx.

So in particular, your hard disk and all its files play no role. Rexx has its own hard disk, and all your file manipulations with ls and cp and vi operate only on those files. The files on your hard disk are outside their reach. Similary files on rexx are outside the reach of your computer. Commands on neither computer can operate upon files on the other.

So once in a while, when you decide you'd like to move a file between the 2 computers, how can it be done? Your usual tool-- telnet-- can't. You have to turn to another program on your machine that's specialized in moving files. The program is an ftp program. ftp stands for "file transfer protocol," but people just say "ftp." It refers to both the "protocol" or method used to move the files, and to the programs that embody this protocol and do the job.

So how is it done with ftp?

ftp originated in the Unix world a long time ago. People wanted to move files computer-to-computer and there wasn't any way to do it. So they scratched their heads, worked hard, and invented ftp as the result of their efforts. ftp comes in 2 parts-- it's 2 programs that work together hand-in-hand. They were designed together, each for the other. One part is called the ftp server, the other the ftp client. The server runs on a computer that has a lot of files to give to people. People run the client program on their machines with which to acquire those files, through interaction with the server program. So mostly files travel from the machine that's running the ftp server program to the one that's running the ftp client program. That's called "downloading." It's also possible to upload, putting files from the client to the server-- if the server is set up for it. There are different ways a server can be set up, determining what the client can and cannot do.

By the way, telnet works the same way, with a server half and a client half. When you access rexx, you are running a telnet client. It's not apparent to you, but rexx is running a telnet server program. If it weren't, your telnet client program would be unable to talk to rexx.

Just as Microsoft borrowed telnet from the Unix world by building a telnet client program into its Windows operating system, they also built in an ftp client program. It runs in the MS-DOS box, is character-based as opposed to graphical, and generally hard to use at first. So a number of graphical ftp programs have been written and are widely available to Windows users. Also, browsers have limited ftp client capability built in.

Below is a session using Windows' built-in ftp client. In this session, the user connects to the ftp server running on rexx. He then issues commands to navigate to the directory containing the file vi.txt, and to download it. Then he quits. The result is that a copy of vi.txt resides on his computer, freshly arrived from rexx. Note that in order to use this you have to learn the commands used by the ftp client, such as "cd," "get," and "quit" seen below.

When you use one of the graphical ftp clients, you don't need to know the commands. It's a lot easier, but you are doing the same thing. Below is a session using WS-FTP, a widely used graphical ftp client for Windows. In this session, the user connects to the ftp server running on rexx. He then clicks on folders to navigate to the directory containing the file vi.txt. To download it, he highlights its name then presses the left arrow button. When he wants to quit he can press the Exit button. The result is that a copy of vi.txt resides on his computer, freshly arrived from rexx. This is identical to the previous session. Except one uses a character-based client tool, the other a graphical one.

A third ftp client available to you is built into your browser! (Browsers are surprisingly versatile programs.) Below is a session using the Netscape Navigator browser. (Internet Explorer is very similar.) In this session, the user connects to the ftp server running on rexx by entering "" in the browser's Location bar. Note the use of ftp:// in place of the more common http://. That tells the multilingual browser to speak the file transfer language, or protocol, during this session instead of the hypertext transfer language. The user can then click on folders shown in the browser to navigate to the directory containing the file vi.txt. To download it, he right-clicks its name to see the context menu shown. He can download it by selecting "Save link as." The result is that a copy of vi.txt resides on his computer, freshly arrived from rexx. This is identical to the previous sessions; you've seen three different methods to transfer files from rexx to your computer.

By the way, if you want to try WS-ftp it's free, and the file you need to install it, ws_ftple.exe, is on rexx available for ftp download (notice it appears in the above screenshots). Why don't you try to download it using your browser, then install it. There are many files available on the internet through ftp. It's good to be equipped with an ftp client and familiar with it.

Anonymous versus regular ftp logins

What if you want to transfer files to rexx from your computer? Well, you must have an account and supply your username and password. If you don't have an account, then the server may permit "anonymous" logins. In that case, when the ftp program asks you for your name just give it the word "anonymous." If it asks for a password give it your email address (it may accept no password at all).

What's the operational difference between an ftp session after you have logged in using your user name, as opposed to using "anonymous?" For one thing, typically, anonymous users can only download files but not upload them. This depends on how the server is set up but that's how most servers do it, including rexx. For another, when you log in with your real account name you can cd all over the disk but when you're anonymous you are confined to a small subdirectory (on rexx it's /pub/ftp). You cannot cd out of it, and are not aware of the larger filesystem of which it is a part. When logging in with Windows' character based ftp client or WS-ftp, you explicitly give "anonymous" as your username when asked. When using a browser, you are never asked. Behind the scenes however, the ftp server does ask, and the browser sends back "anonymous" automatically, so the result is an anonymous session.

Why don't you try connecting to with an ftp client twice. Once, tell it you regular username and password. Then the second time, give it "anonymous" for username instead. While you're in, observe the differences between the two kinds of sessions.

A quick and dirty way to move just text

Your Windows telnet program is 2 things. It's a telnet program, and it's a Windows program. Since it's a Windows program it can participate in the usual things offered by the Windows environment, as any other Windows program can. For example, the clipboard, that is, cutting and pasting. In Windows, pasting text is just an automatic way to type a lot of stuff all at once by pressing a button.

If you have text in a Windows file that you would like to put in a file on rexx, one way to get it there would be to telnet to rexx, open an editor like vi, and transcribe the text by typing it into vi and saving it. Well, that's what you do except when you get to the point where you are ready to start typing (just after pressing the "i" key to put vi into the insert mode), use your Windows telnet client's paste option (probably on its edit menu) to do the typing for you. Then continue as you would if you were doing the whole thing manually and when ready, save and quit from vi. You now have the text that originated on your computer under Windows safely captured in a file on rexx. Remember though, if using vi at the receiving end, you can't paste anything into it if it isn't receptive-- that is, if it hasn't been placed into insert/edit mode first. This is no different than typing manually, vi won't listen to what you type if it isn't in insert mode before you start.


Links about ftp and WS-ftp in particular: