1ct_ftp(3)                  Erlang Module Definition                  ct_ftp(3)
2
3
4

NAME

6       ct_ftp - FTP client module (based on the FTP support of the Inets
7           application).
8

DESCRIPTION

10       FTP client module (based on the FTP support of the Inets application).
11

DATA TYPES

13         connection() = handle() | target_name():
14
15
16           For target_name, see module ct.
17
18         handle() = handle():
19
20
21           Handle for a specific FTP connection, see module ct.
22

EXPORTS

24       cd(Connection, Dir) -> ok | {error, Reason}
25
26              Types:
27
28                 Connection = connection()
29                 Dir = string()
30
31              Changes directory on remote host.
32
33       close(Connection) -> ok | {error, Reason}
34
35              Types:
36
37                 Connection = connection()
38
39              Closes the FTP connection.
40
41       delete(Connection, File) -> ok | {error, Reason}
42
43              Types:
44
45                 Connection = connection()
46                 File = string()
47
48              Deletes a file on remote host.
49
50       get(KeyOrName, RemoteFile, LocalFile) -> ok | {error, Reason}
51
52              Types:
53
54                 KeyOrName = Key | Name
55                 Key = atom()
56                 Name = target_name()
57                 RemoteFile = string()
58                 LocalFile = string()
59
60              Opens an FTP connection and fetches a file from the remote host.
61
62              RemoteFile and LocalFile must be absolute paths.
63
64              The configuration file must be as for ct_ftp:put/3.
65
66              For target_name, see module ct.
67
68              See also ct:require/2.
69
70       ls(Connection, Dir) -> {ok, Listing} | {error, Reason}
71
72              Types:
73
74                 Connection = connection()
75                 Dir = string()
76                 Listing = string()
77
78              Lists directory Dir.
79
80       open(KeyOrName) -> {ok, Handle} | {error, Reason}
81
82              Types:
83
84                 KeyOrName = Key | Name
85                 Key = atom()
86                 Name = target_name()
87                 Handle = handle()
88
89              Opens an FTP connection to the specified node.
90
91              You can open a connection for a particular Name and use the same
92              name as reference for all following  subsequent  operations.  If
93              you want the connection to be associated with Handle instead (if
94              you, for example, need to open multiple connections to a  host),
95              use Key, the configuration variable name, to specify the target.
96              A connection without an  associated  target  name  can  only  be
97              closed with the handle value.
98
99              For information on how to create a new Name, see ct:require/2.
100
101              For target_name, see module ct.
102
103       put(KeyOrName, LocalFile, RemoteFile) -> ok | {error, Reason}
104
105              Types:
106
107                 KeyOrName = Key | Name
108                 Key = atom()
109                 Name = target_name()
110                 LocalFile = string()
111                 RemoteFile = string()
112
113              Opens an FTP connection and sends a file to the remote host.
114
115              LocalFile and RemoteFile must be absolute paths.
116
117              For target_name, see module ct.
118
119              If  the target host is a "special" node, the FTP address must be
120              specified in the configuration file as follows:
121
122               {node,[{ftp,IpAddr}]}.
123
124              If the target host is something else, for example, a UNIX  host,
125              the  configuration file must also include the username and pass‐
126              word (both strings):
127
128               {unix,[{ftp,IpAddr},
129                      {username,Username},
130                      {password,Password}]}.
131
132              See also ct:require/2.
133
134       recv(Connection, RemoteFile) -> ok | {error, Reason}
135
136              Fetches a file over FTP.
137
138              The file gets the same name on the local host.
139
140              See also ct_ftp:recv/3.
141
142       recv(Connection, RemoteFile, LocalFile) -> ok | {error, Reason}
143
144              Types:
145
146                 Connection = connection()
147                 RemoteFile = string()
148                 LocalFile = string()
149
150              Fetches a file over FTP.
151
152              The file is named LocalFile on the local host.
153
154       send(Connection, LocalFile) -> ok | {error, Reason}
155
156              Sends a file over FTP.
157
158              The file gets the same name on the remote host.
159
160              See also ct_ftp:send/3.
161
162       send(Connection, LocalFile, RemoteFile) -> ok | {error, Reason}
163
164              Types:
165
166                 Connection = connection()
167                 LocalFile = string()
168                 RemoteFile = string()
169
170              Sends a file over FTP.
171
172              The file is named RemoteFile on the remote host.
173
174       type(Connection, Type) -> ok | {error, Reason}
175
176              Types:
177
178                 Connection = connection()
179                 Type = ascii | binary
180
181              Changes the file transfer type.
182
183
184
185Ericsson AB                  common_test 1.15.4.2                    ct_ftp(3)
Impressum