📄 readme.ftplib_v2
字号:
FTP Library Routines Release 2Thomas Pfau (pfau@nbpfaus.net)March 15, 1997This package implements a callable interface to FTP. The FTP protocol isspecified in RFC 959. The library should build on linux, VMS, DEC Unix(OSF/1) and Windows NT. Since I no longer have access to a DEC Unix orWindows NT system, it will be difficult for me to support the package onthese platforms.All programs using the library should include ftplib.h.The routines look at the global variable ftplib_debug to determine howmuch information they should display. Level 1 has been left for userprograms. Level 2 displays all responses received from the server.Level 3 displays all commands sent to the server.There have been a few changes since the first release of this library. Ihave added an argument to most routines called a 'netbuf'. This is apointer to a data structure which maintains the state of the connectionto the server. Using this method allows calling programs to openmultiple connections simultaneously. FtpConnect() will return a pointer toa netbuf. Pass this netbuf back to the other routines to talk to theserver. The buffer is freed by FtpQuit(). Since the response buffer isnow in this data structure, it can no longer be accessed via the globalvariable ftplib_lastresp. The function FtpLastResponse() has been addedto replace it.Since the argument lists changed, old programs would have beenincompatible with the new library. Therefore, I changed the functionnames from ftp*() to Ftp*(). Also, ftpOpen() has been renamed toFtpConnect(). In order to allow existing programs to compile, I addedsome macros to ftplib.h to mask the differences. qftp.c still uses theold interface via the macros in ftplib.h.---The following routines are implemented:void FtpInit(void);This routine should be called prior to any other routines. On mostoperating systems, it is a no-op but some others don't implement TCP/IPas seamlessly as others (Windows NT).int FtpConnect(const char *host, netbuf **nControl);Establishes a connection to the named host. Returns success/fail.int FtpLogin(const char *user, const char *pass, netbuf *nControl);Logs in using the specified username and password. Returns success/fail.int FtpSite(const char *cmd, netbuf *nControl);Issues the specified SITE command. See RFC 959 for more information.int FtpMkdir(const char *path, netbuf *nControl);Sends a create directory request to the server using the specified path.Returns success/fail.int FtpChdir(const char *path, netbuf *nControl);Sends a change working directory request to the server using thespecified path. Returns success/fail.int FtpRmdir(const char *path, netbuf *nControl);Sends a remove directory request to the server using the specified path.Returns success/fail.int FtpNlst(const char *outputfile, const char *path, netbuf *nControl);Sends an NLST command to the server with the specified path. Theresponse to this is a list of file names which will be written to thefile named in outputfile. If outputfile is specified as NULL, the listwill be written to stdout.int FtpDir(const char *outputfile, const char *path, netbuf *nControl);Sends a LIST command to the server with the specified path. The responseto this is usually a long format directory listing which will be writtento the file named in outputfile. If outputfile is specified as NULL, thelist will be written to stdout.int FtpGet(const char *outputfile, const char *path, char mode, netbuf *nControl);Retreives the file specified by path and writes it to the file specifiedin outputfile. Image or ASCII transfer mode can be specified by settingmode to 'I' or 'A', respectively.int FtpPut(const char *inputfile, const char *path, char mode, netbuf *nControl);Sends the file specified by inputfile to the server with the namespecified in path. Image or ASCII transfer mode can be specified bysetting mode to 'I' or 'A', respectively.int FtpRename(const char *src, const char *dst, netbuf *nControl);Renames the remote file specified by src to the name specified in dst.int FtpDelete(const char *fnm, netbuf *nControl);Removes the specified file from the server.void FtpQuit(void, netbuf *nControl);Disconnects from the remote server.char *FtpLastResponse(netbuf *nControl);Returns a pointer to the buffer containing the last response receivedfrom the server. Useful for displaying error messages.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -