sftp_ex v0.2.2 SFTP.TransferService

Provides data transfer related functions

Summary

Functions

Downloads a remote path {:ok, data} if successful, {:error, reason} if unsuccessful

Similar to IO.each_binstream this returns a tuple with the data and the file handle if data is read from the server. If it reaches the end of the file then {:halt, handle} is returned where handle is the file handle

Writes a file to a remote path given a file, remote path, and connection

Writes data to a open file using the channel PID

Functions

download(connection, remote_path)

Downloads a remote path {:ok, data} if successful, {:error, reason} if unsuccessful

each_binstream(connection, handle, byte_length)

Similar to IO.each_binstream this returns a tuple with the data and the file handle if data is read from the server. If it reaches the end of the file then {:halt, handle} is returned where handle is the file handle

upload(connection, remote_path, file_handle)

Writes a file to a remote path given a file, remote path, and connection.

write(connection, handle, data)

Writes data to a open file using the channel PID