Transferring files using FTP


Back to Highlights

Mercury to Hercules

In some sections of your labs, you will be asked to transfer some documents, for example, sample C++ applications from Mercury -- the CS Department instructor's machine, to Hercules -- the machine where you have your accounts.  To do this you use the command-line FTP program located on Hercules.

The following is a sample session showing how to transfer hello.cpp, from Mercury's pub/class/110-130/ftp/cpp directory to your Hercules account.
First, from Hercules, change to the directory where you want to store this file, and then follow the following procedures.
Note: The commands in red are those that you are supposed to enter.  The instructions for responding to particular prompts are in bold.

hercules[1]%ftp ftp 
Connected to MERCURY.CS.UREGINA.CA.
220-
220- Access to this system is provided to U of R Computer Science users
220- in support of education and research.
220-
220- Unauthorized access is prohibited.
220-
220 MERCURY.CS.UREGINA.CA FTP server ready.
Name (ftp:guili): anonymous
331 Guest login ok, type your name as password.
Password:		(JUST Type in your WebMail address HERE)
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ascii       (NOTICE YOU MUST ENTER THE ascii MODE) 
200 Type set to A.
ftp> cd pub/class/110-130/ftp/cpp
250 CWD command successful.
ftp> get hello.cpp
local: hello.cpp remote: hello.cpp
200 PORT command successful.
150 Opening ASCII mode data connection for 'hello.cpp' (577 bytes).
226 Transfer complete.
602 bytes received in 0.02 seconds (31.39 Kbytes/s)
ftp> quit
221 Goodbye.
hercules[2]%

Hercules to a PC

Now why would you want to do this?

The answer is that in order to use the printer in CL135, you must print directly from the PC, not from a Telnet to Hercules session. Let's suppose you have the file hello.cpp in your Hercules account space and have made some changes to it. You want to get a printout of it.

To do this you use the graphical FTP program located on the PC. Go to the PC desktop and double click the FTP icon.





You will then see a "connect" screen in which you need to select "Hercules" and enter your username and password. Click on the OK button when you have this set up.

When you have established connection, set up the "Remote" side of the window, (the right side), to the desired location in your Hercules account. On the "Local" side, (the left half of the window), you should be located in C:\Workarea. This is fine, you just want a temporary location to hold the file. Make sure you have selected Ascii for a text file, and then click on the left arrow in the center of the screen.

When you have completed your transfer you can go to Notepad in the Tools folder to read in your file and print it out.

Back to Highlights


This page last modified:
Thursday, 06-Oct-2011 12:13:32 CST
Accessed     times.

CS Dept Home Page
CS Dept Class Files
CS110-130 Class Files


Copyright: Department of Computer Science, University of Regina.