Skip to content
Myr

windows compatibility (#35)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

windows compatibility

authored by Sebastiaan Vermeulen · committed by David Peter · parent 2ea23c0 · Browse files · 1 file+5 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−0 removed

  • other:+5 added−0 removed

1 file+5 added−0 removed

modified:src/main.rs+5 added
10 unmodified lines
11use std::error::Error;12use std::ffi::OsStr;13use std::fs;14use std::io::Write;15#[cfg(target_family = "unix")]16use std::os::unix::fs::PermissionsExt;17use std::path::{Path, Component};18use std::process;19
57 unmodified lines
77 Some(p) => p,78 None => return79 };8081 #[cfg(target_family = "unix")]82 let is_executable = |p: &std::path::PathBuf| {83 p.metadata()84 .ok()85 .map(|f| f.permissions().mode() & 0o111 != 0)86 .unwrap_or(false)87 };8889 #[cfg(not(target_family = "unix"))]90 let is_executable = |p: &std::path::PathBuf| {false};9192 if let Some(ref ls_colors) = config.ls_colors {93 let mut component_path = base.to_path_buf();9495 if config.path_display == PathDisplay::Absolute {
206 unmodified lines