# `WardrikWorkspace.Writes`

The file tools that change files: `write_file`, `edit_file` and `delete_file`.

Each change is made over the version read. If another writer got there first, an append, an
edit or a delete reads the file again and retries, up to eight times in all.

A written file gets the labels of what the writing run had read. An append or an edit also keeps
the file's existing labels.

Files are at most 4 MiB.

# `delete_file`

```elixir
@spec delete_file(WardrikWorkspace.Spec.t(), map()) :: {:ok, map()}
```

Deletes a file. The answer says whether it was there.

# `edit_file`

```elixir
@spec edit_file(WardrikWorkspace.Spec.t(), map(), WardrikCore.Context.t()) ::
  {:ok, map()}
```

Replaces text in a file, once or, with `all`, everywhere it appears.

# `write_file`

```elixir
@spec write_file(WardrikWorkspace.Spec.t(), map(), WardrikCore.Context.t()) ::
  {:ok, map()}
```

Writes a whole file over the version read, or appends to its end.

---

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