exfile v0.2.3 Exfile.File

Represents a file stored on a Backend.

Summary

Functions

Deletes a file

Checks if the file given actually exists in the backend or not

Opens a file

Returns the size, in bytes, of an Exfile.File

Returns the URI of this file

Types

t :: %Exfile.File{backend: map, backend_meta: map, id: binary, meta: map}

Functions

delete(file)

Specs

delete(t) :: :ok | {:error, :file.posix}

Deletes a file.

exists?(file)

Specs

exists?(t) :: boolean

Checks if the file given actually exists in the backend or not.

open(file)

Specs

open(t) ::
  {:ok, %Exfile.LocalFile{io: term, meta: term, path: term}} |
  {:error, :file.posix}

Opens a file.

size(file)

Specs

size(t) :: {:ok, pos_integer} | {:error, :file.posix}

Returns the size, in bytes, of an Exfile.File.

uri(file)

Specs

uri(t) :: String.t

Returns the URI of this file.