1.4 KiB
1.4 KiB
module ftp
Contents
new
fn new() FTP
new returns an FTP instance.
FTP
connect
fn (mut zftp FTP) connect(oaddress string) !bool
connect establishes an FTP connection to the host at oaddress (ip:port).
login
fn (mut zftp FTP) login(user string, passwd string) !bool
login sends the "USER user" and "PASS passwd" commands to the remote host.
close
fn (mut zftp FTP) close() !
close closes the FTP connection.
pwd
fn (mut zftp FTP) pwd() !string
pwd returns the current working directory on the remote host for the logged in user.
cd
fn (mut zftp FTP) cd(dir string) !
cd changes the current working directory to the specified remote directory dir.
dir
fn (mut zftp FTP) dir() ![]string
dir returns a list of the files in the current working directory.
get
fn (mut zftp FTP) get(file string) ![]u8
get retrieves file from the remote host.