Depot v0.2.1 Depot.Adapter.Local View Source
Depot Adapter for the local filesystem.
Direct usage
iex> {:ok, prefix} = Briefly.create(directory: true)
iex> filesystem = Depot.Adapter.Local.configure(prefix: prefix)
iex> :ok = Depot.write(filesystem, "test.txt", "Hello World")
iex> {:ok, "Hello World"} = Depot.read(filesystem, "test.txt")
Usage with a module
defmodule LocalFileSystem do
use Depot.Filesystem,
adapter: Depot.Adapter.Local,
prefix: prefix
end
LocalFileSystem.write("test.txt", "Hello World")
{:ok, "Hello World"} = LocalFileSystem.read("test.txt")