View Source Unzip.FileAccess protocol (unzip v0.12.0)

Should be implemented for the module which can read from the file system.

Summary

Functions

Reads the chunk of data from the file.

Returns the size of the file in bytes.

Types

@type chunk() :: binary()
@type reason() :: term()
@type t() :: FileAccess.t()

Functions

Link to this function

pread(file, offset, length)

View Source
@spec pread(t(), non_neg_integer(), pos_integer()) ::
  {:ok, chunk()} | {:error, reason()}

Reads the chunk of data from the file.

It should return {:ok, binary} where binary is the chunk found at offset with length length

@spec size(t()) :: {:ok, pos_integer()} | {:error, reason()}

Returns the size of the file in bytes.