[comp.sources.wanted] Application Programming Interface for FTP

whna@cgch.UUCP (Heinz Naef) (01/06/88)

Did anyone develop a (limited) FTP client, implemented as a C programming
library, usable from within application programs to allow them to request
standard FTP servers in the network to send or receive a file?

Do any standard semantics exist for such an application programming interface?

Any comments are welcome.

Regards,
Heinz Naef, c/o CIBA-GEIGY AG, R-1032.5.62, P.O.Box, CH-4002 Basel, Switzerland
uucp: cgch!whna - bitnet: whna%cgch.uucp@cernvax.bitnet
                  phone: (+41) 61 37 26 75
                  fax:   (+41) 61 36 43 54 (Attn: H.Naef, R-1032.5.62)

lm@arizona.edu (Larry McVoy) (01/16/88)

In article <571@cgcha.cgch.UUCP> whna@cgch.UUCP (Heinz Naef) writes:
>Did anyone develop a (limited) FTP client, implemented as a C programming
>library, usable from within application programs to allow them to request
>standard FTP servers in the network to send or receive a file?
>
How about

/*
 * send a file via ftp
 *
 * Bugs	- no error checking/handling
 *	- password is in cleartext
 */
send(host, user, passwd, file)
	char* host;
	char* user;
	char* passwd;
	char* file;
{
	FILE* ftp;

	ftp = popen("ftp", "w");
	fprintf(ftp, "open %s\n", host);
	fprintf(ftp, "%s\n", user);
	fprintf(ftp, "%s\n", passwd);
	fprintf(ftp, "put %s\n", file);
	pclose(ftp);
}