MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / canonicalize_existing_file

Function canonicalize_existing_file

crates/openshell-driver-docker/src/lib.rs:3392–3405  ·  view source on GitHub ↗
(path: &Path, description: &str)

Source from the content-addressed store, hash-verified

3390}
3391
3392fn canonicalize_existing_file(path: &Path, description: &str) -> CoreResult<PathBuf> {
3393 if !path.is_file() {
3394 return Err(Error::config(format!(
3395 "{description} '{}' does not exist or is not a file",
3396 path.display()
3397 )));
3398 }
3399 std::fs::canonicalize(path).map_err(|err| {
3400 Error::config(format!(
3401 "failed to resolve {description} '{}': {err}",
3402 path.display()
3403 ))
3404 })
3405}
3406
3407pub(crate) fn validate_linux_elf_binary(path: &Path) -> CoreResult<()> {
3408 let mut file = std::fs::File::open(path).map_err(|err| {

Callers 2

docker_guest_tls_pathsFunction · 0.85

Calls 1

configFunction · 0.85

Tested by

no test coverage detected