# Recording files

> The folder .ormaos/r<N>/ and its JSON lines files, in the provisional format provisional-0.

> **Provisional.**
> The format is provisional and will change. Every file starts with a line that says `"format": "provisional-0"`. Read recordings with the `ormaos` verbs and `--json`, not by parsing the files.


## The folder

A recording is `.ormaos/r<N>/` in the directory where the command ran, with `N` the next free number. `.ormaos/` has its own `.gitignore`, which ignores everything in it. Ormaos sets no limit on the size of `.ormaos/` and deletes nothing from it.

```text
.ormaos/
  .gitignore
  r1/
    run.jsonl                 written by ormaos run, or by the block
    p<pid>-<time>.jsonl       one per Python process
```

## `run.jsonl`

Its first line has only `core`: what a recorder of any language would write.

| Field | What |
|---|---|
| `ormaos` | the version that recorded |
| `mode` | `run` for `ormaos run`, `record` for `with ormaos.record():` |
| `command` | the command, by name and shape (see [Shapes, not values](/python/concepts/shapes-and-values.md)) |
| `cwd` | the working directory |
| `env_names` | the names of the environment variables, never their values |
| `platform` | `linux` |
| `git` | the commit and whether there are uncommitted changes, as hashes and counts: no file name, no branch name, no content |
| `only` | the capabilities asked for with `--only`, or null |
| `values` | whether values were asked for |
| `anchor` | `{"t": 0, "unix": ..., "clock": "monotonic, nanoseconds"}` |

## `p<pid>-<time>.jsonl`

The first line of a process file has two parts:

- `core`: the process (`pid`, `ppid`, `cwd`), the `capabilities` that were recorded (`context`, `calls`, `exceptions`, `path`, `io`, `logs`, `dataframes`, `tensors`, and `values` when the run asked for them), `values` (`false`, or what was recorded of them and how it was cut and masked), what is never recorded, and `anchor`.
- `python`: what only this recorder knows: the version, the executable, how Python was started, whether the process was forked, the path scope.

## Times

Event times (`t`) are nanoseconds on a monotonic clock. `anchor` ties them to the wall clock: it says which moment `t = 0` was.

## Written while the program runs

The recorder writes after every 256 records, when the oldest waiting record is 0.2 seconds old (checked when a record arrives), and when a call that has no call of your code above it starts or ends. Each write ends with a checkpoint: the calls that have not returned, the exceptions whose end is not known, and whether anything is still unwritten. So a recording can be read while the program is still running, and after `kill -9`; `ormaos show` then marks it `(incomplete)`.

---

Source: https://docs.ormaos.com/python/reference/recording-files/ · ormaos 0.0.1 · ormaos-python 968f69776c · ormaos-examples 6e27be5922
