MCPcopy Create free account
hub / github.com/base/base / workload_output_dir

Method workload_output_dir

etc/systems/src/benchmark_cli.rs:630–640  ·  view source on GitHub ↗

Returns the output directory for one workload after validating that it cannot escape root.

(root: &Path, workload: &str)

Source from the content-addressed store, hash-verified

628
629 /// Returns the output directory for one workload after validating that it cannot escape root.
630 pub fn workload_output_dir(root: &Path, workload: &str) -> Result<PathBuf> {
631 eyre::ensure!(
632 !workload.is_empty()
633 && workload != "."
634 && workload != ".."
635 && !workload.contains('/')
636 && !workload.contains('\\'),
637 "workload must be a single directory name: {workload:?}"
638 );
639 Ok(root.join(workload))
640 }
641
642 /// Writes one JSON artifact and ensures its parent directory exists.
643 pub fn write_json<T: Serialize>(path: &Path, value: &T, artifact: &str) -> Result<()> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected