Skip to main content

Module saved_file

Module saved_file 

Source
Expand description

Read back the files that fallow saves, such as baselines, snapshots and setup state.

A flag or a default names each file. A cloned repository can commit a symlink at that path, so a path below the project root or the working directory must resolve inside that directory. A path outside both is a plain path that the user names, and it stays allowed. Each file must be a regular file of at most DEFAULT_MAX_READ_BYTES bytes.

A parse error names the position only, because the serde text can quote a value of the file.

Functionsยง

base_in_path_spelling
The ancestor of path, with .. and . applied by text, that is base. A base can have another spelling through a link, such as /tmp for /private/tmp on macOS, so an ancestor that resolves to base also counts. A link below that ancestor does not move path out of base: the caller then checks where that link resolves. None when path is not below base.
json_error_position
The position of a JSON error, for a message that must not quote the file. An error of a typed conversion has no position, so it gets a fixed text.
lies_below
True when path, with .. and . applied by text, is base or below it. See base_in_path_spelling.
read_saved_file
Read the saved file at path, with root and the working directory as bases. A relative path is taken relative to the working directory.
read_saved_file_in_cwd
read_saved_file for a caller that has no project root. Only the working directory is a base.
read_saved_text
read_saved_file with an optional root and the limit max_bytes.