A Julia interface for running a test FTP server with pyftpdlib.
FTPServer makes use of PyCall for running the FTP server.
It's recommended that you use PYTHON=""
so that Julia uses its own Python distribution.
However, if you wish to specify a system Python you will need to use at least Python 3 and install the Python packages pyopenssl
and pyftpdlib
.
Since this package is primarily intended for test ftp logic, we recommend using the FTPServer.serve
do-block syntax to handle cleaning your test ftp server.
using FTPClient
using FTPServer
# Initialize a root directory to run servers from
FTPServer.init()
# Run some tests
FTPServer.serve() do server
opts = (
:hostname => FTPServer.hostname(server),
:port => FTPServer.port(server),
:username => FTPServer.username(server),
:password => FTPServer.password(server),
)
options = RequestOptions(; opts..., ssl=false)
ctxt, resp = ftp_connect(options)
...
end
# Cleanup the shared FTP directory
FTPServer.cleanup()