SFTP Client v1.3.3 SFTPClient.Operations.OpenFile 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
open_file(conn, path, modes)
View Source
open_file(SFTPClient.Conn.t(), Path.t(), [SFTPClient.access_mode()]) ::
{:ok, SFTPClient.Handle.t()} | {:error, SFTPClient.error()}
open_file(SFTPClient.Conn.t(), Path.t(), [SFTPClient.access_mode()]) :: {:ok, SFTPClient.Handle.t()} | {:error, SFTPClient.error()}
Opens a file on the server and returns a handle, which can be used for reading or writing.
open_file(conn, path, modes, fun)
View Source
open_file(
SFTPClient.Conn.t(),
Path.t(),
[SFTPClient.access_mode()],
(SFTPClient.Handle.t() -> res)
) :: {:ok, res} | {:error, SFTPClient.error()}
when res: var
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.
open_file!(conn, path, modes)
View Source
open_file!(SFTPClient.Conn.t(), Path.t(), [SFTPClient.access_mode()]) ::
SFTPClient.Handle.t() | no_return()
open_file!(SFTPClient.Conn.t(), Path.t(), [SFTPClient.access_mode()]) :: SFTPClient.Handle.t() | no_return()
Opens a file on the server and returns a handle, which can be used for reading or writing. Raises when the operation fails.
open_file!(conn, path, modes, fun)
View Source
open_file!(
SFTPClient.Conn.t(),
Path.t(),
[SFTPClient.access_mode()],
(SFTPClient.Handle.t() -> res)
) :: res | no_return()
when res: var
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.