Skip to main content

path_for

Function path_for 

Source
pub fn path_for(dir: &Path, bench: &str, subject: &str) -> Result<PathBuf>
Expand description

Where tak run --profile-dir DIR keeps a subject’s profile: DIR/<bench>/<subject>.cachegrind.out.

Benchmark and subject names come from tak.toml keys, which may be any string. A name that is not a single, ordinary path component is refused rather than escaped: [bench."../x"] writing outside the directory is the failure being prevented, and an escaped name would no longer be the name a reader looks for.

Control characters go through crate::record::check_name, the one check every recorded name passes; tak.toml, --bench and TAK_TOOL have normally been through it already. What is added here is only what a file name needs beyond a recorded one.