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-gate0.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     #include <string.h>
3    
4     // sunos does not prototype this in stdio.h
5     extern "C" char* getpass (char* prompt);
6    
7     int main (int ac, char** av)
8     {
9     // This is an ftp client.
10     // It puts a file at the remote site outside the
11     // nsc firewall. Donot use this outside of NSC.
12     if (ac != 4) {
13     cerr << "USAGE: "
14     << av [0]
15     << " user@hostname localfilepath remotefilepath\n";
16     return 1;
17     }
18    
19     ftp f (&cout);
20    
21     // establish connection
22     f->connect ("gatekeeper.nsc.com");
23     f->get_response (); // get the connection response
24    
25     // set access
26     f->user (av [1]);
27     f->passwd (getpass ("Password: "));
28    
29     // get help
30     f->help ();
31    
32     // set representation type to image
33     f->rep_type (ftp::rt_image);
34    
35     // put a file
36     f->putfile (av [2], av [3]);
37    
38     // quit
39     f->quit ();
40     }
41