SFTPClient.Operations.OpenFile (SFTP Client v1.4.6) View Source

A module that provides functions to open a file on an SFTP server in order to read their contents.

Link to this section Summary

Functions

Opens a file on the server and returns a handle, which can be used for reading or writing.

Opens a file on the server and returns a handle, which can be used for reading or writing, then runs the function and closes the handle when finished.

Opens a file on the server and returns a handle, which can be used for reading or writing. Raises when the operation fails.

Opens a file on the server and returns a handle, which can be used for reading or writing, then runs the function and closes the handle when finished. Raises when the operation fails.

Link to this section Functions

Link to this function

open_file(conn, path, modes)

View Source

Specs

Opens a file on the server and returns a handle, which can be used for reading or writing.

Link to this function

open_file(conn, path, modes, fun)

View Source

Specs

open_file(
  SFTPClient.Conn.t(),
  Path.t(),
  [SFTPClient.access_mode()],
  (SFTPClient.Handle.t() -> res)
) :: {:ok, res} | {:error, SFTPClient.error()}
when res: var

Opens a file on the server and returns a handle, which can be used for reading or writing, then runs the function and closes the handle when finished.

Link to this function

open_file!(conn, path, modes)

View Source

Specs

Opens a file on the server and returns a handle, which can be used for reading or writing. Raises when the operation fails.

Link to this function

open_file!(conn, path, modes, fun)

View Source

Specs

open_file!(
  SFTPClient.Conn.t(),
  Path.t(),
  [SFTPClient.access_mode()],
  (SFTPClient.Handle.t() -> res)
) :: res | no_return()
when res: var

Opens a file on the server and returns a handle, which can be used for reading or writing, then runs the function and closes the handle when finished. Raises when the operation fails.