windows compatibility
windows compatibility
@@ -12,6 +12,7 @@ use std::error::Error;
use std::ffi::OsStr;
use std::fs;
use std::io::Write;
+#[cfg(target_family = "unix")]
use std::os::unix::fs::PermissionsExt;
use std::path::{Path, Component};
use std::process;
@@ -77,6 +78,7 @@ fn print_entry(base: &Path, entry: &Path, config: &FdOptions) {
None => return
};
+ #[cfg(target_family = "unix")]
let is_executable = |p: &std::path::PathBuf| {
p.metadata()
.ok()
@@ -84,6 +86,9 @@ fn print_entry(base: &Path, entry: &Path, config: &FdOptions) {
.unwrap_or(false)
};
+ #[cfg(not(target_family = "unix"))]
+ let is_executable = |p: &std::path::PathBuf| {false};
+
if let Some(ref ls_colors) = config.ls_colors {
let mut component_path = base.to_path_buf();
