FTPasta

Package Version Hex Docs

A simple wrapper around Erlang’s built-in ftp module. This library is a work-in-progress, and should not be relied on in its current state.

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)
}

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.

./run_tests.sh
Search Document