4 FTP: Client Downloading
The
net/ftp library provides
utilities for FTP client operations.
The library was written by Micah Flatt.
4.1 Functions
Establishes an FTP connection with the given server using the supplied
username and password. The port-np argument usually should be
21.
Closes an FTP connection.
Changes the current directory on the FTP server to new-dir.
The new-dir argument is not interpreted at all, but simply
passed on to the server; it must not contain a newline.
Returns a list of files and directories in the current directory of the
server, assuming that the server provides directory information in the
quasi-standard Unix format. If a path argument is given, use
it instead of the current directory.
Each file or directory is represented by a list of three or four
strings. The first string is either "-", "d", or
"l", depending on whether the items is a file, directory, or
link, respectively. The second item is the file’s date; to convert this
value to seconds consistent with file-seconds, pass the date
string to ftp-make-file-seconds. The third string is the name
of the file or directory. If the item is a file (the first string is
"-"), and if the line that the server replied with has a size
in the expected place, then a fourth string containing this size is
included.
Warning: the FTP protocol has no specification for the reply format, so
this information can be unreliable.
Warning: the FTP protocol has no specification for the reply format, so
this information can be unreliable.
Downloads file from the server’s current directory and puts
it in local-dir using the same name. If the file already
exists in the local directory, it is replaced, but only after the
transfer succeeds (i.e., the file is first downloaded to a temporary
file, then moved into place on success).
4.2 FTP Unit
ftp@ and ftp^ are deprecated.
They exist for backward-compatibility and will likely be removed in
the future. New code should use the net/ftp module.
Imports nothing, exports
ftp^.
4.3 FTP Signature
Includes everything exported by the net/ftp module.