# `MobSecureStore.File`
[🔗](https://github.com/GenericJam/mob_secure_store/blob/main/lib/mob_secure_store/file.ex#L1)

The off-phone backend (development, tests): one 0600 file per key in a 0700
directory, `config :mob_secure_store, :dir` or else
`Path.join(Mob.data_dir(), "mob_secure_store")`.

Each file is named by the SHA-256 of its key, so any key maps to one safe
filename and no two keys share one. A write goes to a 0600 temporary file
that is synced and renamed over the old one, so a reader sees the old value
or the new one, never part of one; the directory itself isn't synced (Erlang
can't), so a power cut right after `put/2` may lose the rename. Not
encrypted: file permissions are the only protection, which is why a phone
never uses this backend.

# `dir`

```elixir
@spec dir() :: Path.t()
```

The directory the files are kept in.

---

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