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