Example ftp session using Elixir?

I cleared documents, but I can not plunge into work on ftp in Elixir. Can someone please help me give a working example?

+4
source share
1 answer

Here is an example that shows how to use the Erlang FTP client library in the official Erlang documentation . Here's the (unverified) translation in Elixir:

:inets.start
{:ok, pid} = :inets.start(:ftpc, host: 'erlang.org')
:ftp.user(pid, 'guest', 'password')
:ftp.pwd(pid)
:ftp.cd(pid, 'appl/examples')
:ftp.lpwd(pid)
:ftp.lcd(pid, '/home/eproj/examples')
:ftp.recv(pid, 'appl.erl')
:inets.stop(:ftpc, pid)
+8
source

Source: https://habr.com/ru/post/1584838/


All Articles