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

A module that provides functions to read chunks of data from a file on an SFTP server.

Link to this section Summary

Functions

Reads the given number of bytes (length) from the file referenced by handle. If the file is read past eof, only the remaining bytes are read and returned. If no bytes are read, :eof is returned.

Reads the given number of bytes (length) from the file referenced by handle. If the file is read past eof, only the remaining bytes are read and returned. If no bytes are read, :eof is returned. Raises when the operation fails.

Link to this section Functions

Link to this function

read_file_chunk(handle, length)

View Source

Specs

read_file_chunk(SFTPClient.Handle.t(), non_neg_integer()) ::
  {:ok, String.t()} | :eof | {:error, SFTPClient.error()}

Reads the given number of bytes (length) from the file referenced by handle. If the file is read past eof, only the remaining bytes are read and returned. If no bytes are read, :eof is returned.

Link to this function

read_file_chunk!(handle, length)

View Source

Specs

read_file_chunk!(SFTPClient.Handle.t(), non_neg_integer()) ::
  String.t() | :eof | no_return()

Reads the given number of bytes (length) from the file referenced by handle. If the file is read past eof, only the remaining bytes are read and returned. If no bytes are read, :eof is returned. Raises when the operation fails.