[Ericsson AB]

ct_ftp

MODULE

ct_ftp

MODULE SUMMARY

Common Test specific layer on top of OTP ftp clinet ftp.erl.

DESCRIPTION

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.

EXPORTS

cd(Connection, Dir) -> ok | {error, Reason}

Types:

Connection = connection()
Dir = string()

Change directory on remote host.

close(Connection) -> ok | {error, Reason}

Types:

Connection = connection()

Close the FTP connection.

delete(Connection, File) -> ok | {error, Reason}

Types:

Connection = connection()
File = string()

Delete a file on remote host

get(Name, RemoteFile, LocalFile) -> ok | {error, Reason}

Types:

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.

ls(Connection, Dir) -> {ok, Listing} | {error, Reason}

Types:

Connection = connection()
Dir = string()
Listing = string()

List the directory Dir.

open(Name) -> {ok, Handle} | {error, Reason}

Types:

Name = target_name() (see module ct)
Handle = handle()

Open an FTP connection to the specified node.

put(Name, LocalFile, RemoteFile) -> ok | {error, Reason}

Types:

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}]}.

recv(Connection, RemoteFile) -> ok | {error, Reason}

Fetch a file over FTP.

The file will get the same name on the local host.

See also: recv/3.

recv(Connection, RemoteFile, LocalFile) -> ok | {error, Reason}

Types:

Connection = connection()
RemoteFile = string()
LocaFile = string()

Fetch a file over FTP.

The file will be named LocalFile on the local host.

send(Connection, LocalFile) -> ok | {error, Reason}

Send a file over FTP.

The file will get the same name on the remote host.

See also: send/3.

send(Connection, LocalFile, RemoteFile) -> ok | {error, Reason}

Types:

Connection = connection()
LocaFile = string()
RemoteFile = string()

Send a file over FTP.

The file will be named RemoteFile on the remote host.

type(Connection, Type) -> ok | {error, Reason}

Types:

Connection = connection()
Type = ascii | binary

Change file transfer type

AUTHORS

- support@erlang.ericsson.se

common_test 1.3.4
Copyright © 1991-2008 Ericsson AB