(path: &Path)
| 122 | /// Check whether a file is executable. |
| 123 | #[cfg(unix)] |
| 124 | fn is_executable(path: &Path) -> bool { |
| 125 | use std::os::unix::fs::PermissionsExt; |
| 126 | std::fs::metadata(path) |
| 127 | .map(|m| m.permissions().mode() & 0o111 != 0) |
| 128 | .unwrap_or(false) |
| 129 | } |
| 130 | |
| 131 | #[cfg(not(unix))] |
| 132 | fn is_executable(_path: &Path) -> bool { |