INNER CODE UNIT · Rust

is_executable

ngless-toolkit/ngless · src/lib.rs:284

fn is_executable(path: &std::path::Path) -> bool {
    #[cfg(unix)]
    {
        use std::os::unix::fs::PermissionsExt;
        match std::fs::metadata(path) {
            Ok(m) => m.permissions().mode() & 0o111 != 0,
            Err(_) => false,
        }
    }
    #[cfg(not(unix))]
    {
        path.is_file()
    }
}

/// External tools NGLess may invoke, with the environment variable that overrides each one's
/// location and whether `--check-install` requires it (minimap2 is optional: it is only needed for
/// `map(..., mapper='minimap2')`).

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…