Xref: utzoo comp.protocols.tcp-ip:2162 comp.sources.wanted:2958 comp.unix.questions:5054 Path: utzoo!utgpu!water!watmath!clyde!rutgers!princeton!udel!gatech!hao!noao!arizona!lm From: lm@arizona.edu (Larry McVoy) Newsgroups: comp.protocols.tcp-ip,comp.sources.wanted,comp.unix.questions Subject: Re: Application Programming Interface for FTP Keywords: ftp, api, library, programming, application, interface, file, transfer Message-ID: <3471@megaron.arizona.edu> Date: 15 Jan 88 22:02:44 GMT References: <571@cgcha.cgch.UUCP> Reply-To: lm@megaron.arizona.edu.UUCP (Larry McVoy) Organization: University of Arizona, Tucson Lines: 28 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); }