ct_ftp
Common Test specific layer on top of OTP ftp clinet ftp.erl.
Common Test specific layer on top of OTP ftp clinet ftp.erl
DATA TYPES
connection() = handle() | target_name() (see module ct)
handle() = handle() (see module ct_gen_conn)
Handle for a specific ftp connection.
Functions
put(Name, LocalFile, RemoteFile) -> ok | {error, Reason}
Name = target_name()
LocaFile = string()
RemoteFile = string()
Open a ftp connection and send a file to the remote host.
LocalFile
and RemoteFile
must be
absolute paths.
If the target host is a "special" node, the ftp address must be specified in the config file like this:
{node,[{ftp,IpAddr}]}.
If the target host is something else, e.g. a unix host, the config file must also include the username and password (both strings):
{unix,[{ftp,IpAddr}, {username,Username}, {password,Password}]}.
get(Name, RemoteFile, LocalFile) -> ok | {error, Reason}
Name = target_name()
RemoteFile = string()
LocaFile = string()
Open a ftp connection and fetch a file from the remote host.
RemoteFile
and LocalFile
must be
absolute paths.
The config file must be as for put/3.
See also: put/3.
open(Name) -> {ok, Handle} | {error, Reason}
Name = target_name() (see module ct)
Handle = handle()
Open an FTP connection to the specified node.
send(Connection, LocalFile) -> ok | {error, Reason}
send(Connection, LocalFile, RemoteFile) -> ok | {error, Reason}
Connection = connection()
LocaFile = string()
RemoteFile = string()
Send a file over FTP.
The file will be named RemoteFile
on the remote host.
recv(Connection, RemoteFile) -> ok | {error, Reason}
recv(Connection, RemoteFile, LocalFile) -> ok | {error, Reason}
Connection = connection()
RemoteFile = string()
LocaFile = string()
Fetch a file over FTP.
The file will be named LocalFile
on the local host.
cd(Connection, Dir) -> ok | {error, Reason}
Connection = connection()
Dir = string()
Change directory on remote host.
ls(Connection, Dir) -> {ok, Listing} | {error, Reason}
Connection = connection()
Dir = string()
Listing = string()
List the directory Dir.
type(Connection, Type) -> ok | {error, Reason}
Connection = connection()
Type = ascii | binary
Change file transfer type
delete(Connection, File) -> ok | {error, Reason}
Connection = connection()
File = string()
Delete a file on remote host
close(Connection) -> ok | {error, Reason}
Connection = connection()
Close the FTP connection.