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

Function is_executable_file

e2e/rust/src/harness/container.rs:241–258  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

239}
240
241fn is_executable_file(path: &Path) -> bool {
242 if !path.is_file() {
243 return false;
244 }
245
246 #[cfg(unix)]
247 {
248 use std::os::unix::fs::PermissionsExt;
249
250 path.metadata()
251 .is_ok_and(|metadata| metadata.permissions().mode() & 0o111 != 0)
252 }
253
254 #[cfg(not(unix))]
255 {
256 true
257 }
258}
259
260fn command_exists(command: &str) -> bool {
261 if command.contains(std::path::MAIN_SEPARATOR) {

Callers 1

command_existsFunction · 0.85

Calls 1

metadataMethod · 0.80

Tested by

no test coverage detected