# `Sftpd.FileHandler`
[🔗](https://github.com/elixir-ssh/sftpd/blob/v0.1.1/lib/sftpd/file_handler.ex#L1)

Generic file handler for Erlang's ssh_sftpd server module.

This module implements the `:ssh_sftpd_file_api` behaviour and delegates
all storage operations to the configured backend.

## Usage

This module is used internally by `Sftpd.start_server/1`. You typically
don't need to use it directly unless you're customizing the SSH daemon setup.

    :ssh_sftpd.subsystem_spec(
      file_handler: {Sftpd.FileHandler, %{backend: MyBackend, backend_state: state}}
    )

# `io_device`

```elixir
@type io_device() :: pid()
```

IO device handle (GenServer pid)

# `state`

```elixir
@type state() :: %{
  :backend =&gt;
    module()
    | {:genserver, GenServer.server()}
    | {:genserver, GenServer.server(), keyword()},
  :backend_state =&gt; term(),
  optional(:close_timeout) =&gt; timeout(),
  optional(:close_shutdown_grace) =&gt; non_neg_integer(),
  optional(:open_timeout) =&gt; timeout(),
  optional(:session) =&gt; map(),
  optional(:cwd) =&gt; charlist()
}
```

File handler state containing backend module and its state

---

*Consult [api-reference.md](api-reference.md) for complete listing*
