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

NAME

6       ct_ftp - FTP client module (based on the FTP application).
7

DESCRIPTION

9       FTP client module (based on the ftp application).
10

DATA TYPES

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

EXPORTS

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