Skip to content

net.ftp #

fn new #

fn new() FTP

new returns an FTP instance.

fn (FTP) connect #

fn (mut zftp FTP) connect(ip string) ?bool

connect establishes an FTP connection to the host at ip port 21.

fn (FTP) login #

fn (mut zftp FTP) login(user string, passwd string) ?bool

login sends the "USER user" and "PASS passwd" commands to the remote host.

fn (FTP) close #

fn (mut zftp FTP) close() ?

close closes the FTP connection.

fn (FTP) pwd #

fn (mut zftp FTP) pwd() ?string

pwd returns the current working directory on the remote host for the logged in user.

fn (FTP) cd #

fn (mut zftp FTP) cd(dir string) ?

cd changes the current working directory to the specified remote directory dir.

fn (FTP) dir #

fn (mut zftp FTP) dir() ?[]string

dir returns a list of the files in the current working directory.

fn (FTP) get #

fn (mut zftp FTP) get(file string) ?[]u8

get retrieves file from the remote host.