# Appendix 9.A Message Reference

_Peios Specifications / PSPU / File Choosing_

> Every line on the choosing channel, in order, with an example conversation.

| Direction | Line | Defined in |
|---|---|---|
| Requester → chooser | The request (first line, no `type`) | §9.4 |
| Chooser → requester | `{"type":"chosen","path":…}` | §9.5 |
| Chooser → requester | `{"type":"cancelled"}` | §9.5 |

## 9.A.1 An example

A registry editor exports a key. The person goes into a folder, makes a
folder called Backups inside it, opens it, keeps the suggested name and
saves. Lines are shown on several lines here for reading. On the channel
each is one line.

```
→ {"mode":"save","title":"Export Services",
   "purpose":"The key and everything under it is written to a registry document.",
   "folder":"/home/dana","name":"Services.json",
   "filters":[{"name":"Registry documents","extensions":["json"]}]}
← {"type":"chosen","path":"/home/dana/Backups/Services.json"}
```

The chooser ends, and the registry editor writes the file.

## 9.A.2 Choosing a folder

A file server's settings ask where a new share is (revision 2). The
person goes into `/srv`, picks `photos`, and chooses it.

```text
→ {"mode":"folder","title":"Choose a folder to share","folder":"/srv"}
← {"type":"chosen","path":"/srv/photos"}
```

The settings check the folder and share it, as the person.
