ct_ftp(3erl)
π ct_ftp(3erl) β Erlang Module Definition π
β¨ NAME β¨
ct_ftp β FTP client module (based on the FTP application). π
πΈ DESCRIPTION πΈ
Okay so ct_ftp is literally the FTP client module, built on top of the ftp application. No cap, thatβs the whole vibe, and itβs iconic. π¦
π§ DATA TYPES π§
connection() = handle() | target_name()
For target_name, see module ct. π«Ά
handle() = handle()
Handle for a specific FTP connection, see module ct. β¨
π EXPORTS π
π cd(Connection, Dir) -> ok | {error, Reason}
- Types:
Connection = connection()Dir = string()
Changes directory on the remote host. slay. π
π close(Connection) -> ok | {error, Reason}
- Types:
Connection = connection()
Closes the FTP connection. bye bestie π
π delete(Connection, File) -> ok | {error, Reason}
- Types:
Connection = connection()File = string()
Deletes a file on the remote host. ποΈβ¨
π get(KeyOrName, RemoteFile, LocalFile) -> ok | {error, Reason}
- Types:
KeyOrName = Key | NameKey = atom()Name = target_name()RemoteFile = string()LocalFile = string()
Opens an FTP connection and fetches a file from the remote host. π
RemoteFileandLocalFilemust be absolute paths, bestie β absolute, not βwherever I feel like it.β π
The configuration file must be as for ct_ftp:put/3. π
For target_name, see module ct.
See also ct:require/2. π₯
π ls(Connection, Dir) -> {ok, Listing} | {error, Reason}
- Types:
Connection = connection()Dir = string()Listing = string()
Lists directory Dir. πβ¨
π open(KeyOrName) -> {ok, Handle} | {error, Reason}
- Types:
KeyOrName = Key | NameKey = atom()Name = target_name()Handle = handle()
Opens an FTP connection to the specified node. π
You can open a connection for a particular Name and use that same name as the reference for all following subsequent operations. If you want the connection to be associated with Handle instead β like if you, for example, need to open multiple connections to a host β use Key, the configuration variable name, to specify the target. A connection without an associated target name can only be closed with the handle value. π
For information on how to create a new Name, see ct:require/2. π«Ά
For target_name, see module ct.
π put(KeyOrName, LocalFile, RemoteFile) -> ok | {error, Reason}
- Types:
KeyOrName = Key | NameKey = atom()Name = target_name()LocalFile = string()RemoteFile = string()
Opens an FTP connection and sends a file to the remote host. π€β¨
LocalFileandRemoteFilemust be absolute paths, no relative-path chaos. π€
For target_name, see module ct.
If the target host is a "special" node, the FTP address must be specified in the configuration file as follows:
{node,[{ftp,IpAddr}]}.
If the target host is something else, for example, a UNIX host, the configuration file must also include the username and password (both strings):
{unix,[{ftp,IpAddr},
{username,Username},
{password,Password}]}.
See also ct:require/2. π
π recv(Connection, RemoteFile) -> ok | {error, Reason}
Fetches a file over FTP. π₯
The file gets the same name on the local host. π
See also ct_ftp:recv/3. π
π recv(Connection, RemoteFile, LocalFile) -> ok | {error, Reason}
- Types:
Connection = connection()RemoteFile = string()LocalFile = string()
Fetches a file over FTP. π₯
The file is named LocalFile on the local host. π·οΈβ¨
π send(Connection, LocalFile) -> ok | {error, Reason}
Sends a file over FTP. π€
The file gets the same name on the remote host. π
See also ct_ftp:send/3. π
π send(Connection, LocalFile, RemoteFile) -> ok | {error, Reason}
- Types:
Connection = connection()LocalFile = string()RemoteFile = string()
Sends a file over FTP. π€
The file is named RemoteFile on the remote host. π·οΈβ¨
π type(Connection, Type) -> ok | {error, Reason}
- Types:
Connection = connection()Type = ascii | binary
Changes the file transfer type. π
Thatβs the whole vibe check, bestie. This page is ct_ftp(3erl) from Ericsson AB, version common_test 1.24.0.1. byeeee πβ¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms