1 /* other.c by Michael Temari 06/21/92
3 * ftp An ftp client program for use with TNET.
5 * Author: Michael Temari, <temari@ix.netcom.com>
34 struct termios oldtty
, newtty
;
39 printf("You must \"OPEN\" a connection first.\n");
46 tcgetattr(fileno(stdout
), &oldtty
);
48 newtty
.c_lflag
&= ~ECHO
;
49 tcsetattr(fileno(stdout
), TCSANOW
, &newtty
);
50 readline("Password: ", password
, sizeof(password
));
51 tcsetattr(fileno(stdout
), TCSANOW
, &oldtty
);
56 s
= DOcommand("PASS", pass
);
71 printf("You must \"OPEN\" a connection first.\n");
80 readline("Username: ", username
, sizeof(username
));
84 s
= DOcommand("USER", user
);
86 if(atty
&& s
== 331) {
87 cmdargv
[0] = "password";
103 return(DOcommand("NOOP", ""));
108 passive
= 1 - passive
;
110 printf("Passive mode is now %s\n", (passive
? "ON" : "OFF"));
120 return(DOcommand("SYST", ""));
126 printf("You must \"OPEN\" a connection first.\n");
130 return(DOcommand("HELP", ""));
136 static char args
[512];
140 for(i
= 2; i
< cmdargc
; i
++) {
143 strcat(args
, cmdargv
[i
]);
146 return(DOcommand(cmdargv
[1], args
));
152 static char args
[512];
156 for(i
= 1; i
< cmdargc
; i
++) {
159 strcat(args
, cmdargv
[i
]);
162 return(DOcommand("SITE", args
));