FTPasta

Package VersionHex Docs

A simple to use wrapper around Erlang's built-in ftp module.

Example Usage

gleam add ftpasta
import ftpasta
import ftpasta/tls_config
import gleam/io
import gleam/list

pub fn main() {
  // Connect to a server.
  let assert Ok(connection) =
    ftpasta.new("ftp.gnu.org")
    |> ftpasta.encryption(tls_config.Plaintext)
    |> ftpasta.connect()

  // List the files.
  let assert Ok(items) = ftpasta.list(connection, "")
  list.map(items, fn(item) { io.println(item.name) })

  // Close the connection.
  ftpasta.close(connection)
}

Limitations

The Erlang SSL module doesn't support verifying self-signed certificates. To connect to a server using a self-signed cert use the verification(False) option when creation the connection.

Related Projects

Development

The included script run_tests.sh will start two instances of vsftpd with the required configuration, run all tests, and then shut the servers down.