Minimal anonymous-FTP client implementation over :gen_tcp.
Replaces Erlang/OTP's legacy :ftp application (removed in OTP 30) for
retrieving open GNSS archive files and listings over FTP.
Test Seams
:ftp_port- Configured viaApplication.get_env(:sidereon, :ftp_port, 21). Allows overriding the default control port (21) for local test servers.
Summary
Functions
Returns a specification to start this module under a supervisor.
Closes the FTP connection.
Lists contents of a directory.
Opens an FTP control connection to host.
Retrieves the next chunk of the file or signals EOF (:ok).
Starts retrieving a file.
Sets transfer mode (e.g. :binary for TYPE I).
Authenticates with the FTP server (typically anonymous).
Types
@type host() :: charlist() | String.t() | :inet.ip_address()
@type opt() :: {:timeout, pos_integer()} | {:mode, :passive | :active}
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec close(pid()) :: :ok
Closes the FTP connection.
Lists contents of a directory.
Opens an FTP control connection to host.
Retrieves the next chunk of the file or signals EOF (:ok).
Starts retrieving a file.
Sets transfer mode (e.g. :binary for TYPE I).
@spec user(pid(), charlist() | String.t(), charlist() | String.t()) :: :ok | {:error, :epath} | {:error, term()}
Authenticates with the FTP server (typically anonymous).