ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/c++/socket++-1.10/test/tcftp.C
Revision: 1.1
Committed: Mon Feb 26 15:02:39 2001 UTC (23 years, 8 months ago) by ab11
Content type: text/plain
Branch: MAIN
CVS Tags: PROJECT_COMPLETION
Log Message:
Test programs for Networking class. Unused by the host

File Contents

# User Rev Content
1 ab11 1.1 #include <ftp.h>
2    
3     // sunos does not prototype this in stdio.h
4     extern "C" char* getpass (char* prompt);
5    
6     int main (int ac, char** av)
7     {
8     // this is an ftp client
9     // It retrieves the file from the host
10     if (ac != 4) {
11     cerr << "USAGE: " << av [0] << " hostname user filename\n";
12     return 1;
13     }
14    
15     ftp f (&cout);
16    
17     // establish connection
18     f->connect (av [1]);
19     f->get_response (); // get the connection response
20    
21     // set access
22     f->user (av [2]);
23     f->passwd (getpass ("passwd: "));
24    
25     // get help
26     f->help ();
27    
28     // set representation type to image
29     f->rep_type (ftp::rt_image);
30    
31     // list the home directory
32     f->list ();
33    
34     // quit
35     f->quit ();
36     }
37