Unzip.FileAccess protocol (unzip v0.13.0)

View Source

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

chunk()

@type chunk() :: binary()

reason()

@type reason() :: term()

t()

@type t() :: FileAccess.t()

Functions

pread(file, offset, length)

@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

size(file)

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

Returns the size of the file in bytes.