sharkdp/fd · error · anyhow::Error
'fd --list-details' is not supported on this platform.
Error message
'fd --list-details' is not supported on this platform.
What it means
The else branch at main.rs:489 is reached when --list-details is used on a platform that is neither Unix nor Windows (e.g., wasm, redox, or another Tier-3 target). fd has no ls backend for such platforms and refuses rather than emit garbage. It is effectively a 'not implemented for this target' guard.
Solutions
- Run fd on a supported platform (Unix or Windows with GNU ls) when you need --list-details.
- Drop --list-details and post-process results yourself with the platform's native tooling.
- If porting fd, implement a platform-specific ls command builder for your target.
Example fix
# before (unsupported platform)
fd --list-details
# after (no long listing)
fd <pattern> | xargs -I{} ls -l {} Defensive patterns
Strategy: validation
Validate before calling
case "$(uname -s)" in Linux|Darwin|*BSD) fd --list-details ;; MINGW*|MSYS*|CYGWIN*) fd --list-details ;; *) echo "--list-details unsupported on this platform" >&2; exit 1 ;; esac
Prevention
- Gate --list-details behind a platform check in portable scripts.
- Do not enable --list-details in builds targeting non-Unix/non-Windows.
- Fall back to running an external lister manually on unsupported platforms.
When it happens
Trigger: Compiling and running fd with --list-details on a non-Unix, non-Windows target (cfg!(unix) false and cfg!(windows) false).
Common situations: Cross-compiling fd to an unsupported target; running under a Tier-3 OS; experimental/wasm builds.
Related errors
- 'fd --list-details' is not supported on Windows unless GNU…
- A path separator must be exactly one byte, but the given…
- Could not retrieve current directory (has it been deleted?).
- ' ' is not a valid date or duration. See 'fd --help'.
- ' ' is not a valid size constraint. See 'fd --help'.
AI-assisted analysis of sharkdp/fd@ee20f426dd (2026-08-09).
Data as JSON: /api/errors/af990c7e969e9101.
Report an issue: GitHub.
Appendix: source
Thrown at src/main.rs:489
use std::process::{Command, Stdio};
// Use GNU ls, if available
let gnu_ls_exists = Command::new("ls")
.arg("--version")
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.is_ok();
if gnu_ls_exists {
gnu_ls("ls")
} else {
return Err(anyhow!(
"'fd --list-details' is not supported on Windows unless GNU 'ls' is installed."
));
}
} else {
return Err(anyhow!(
"'fd --list-details' is not supported on this platform."
));
};
Ok(cmd)
}
fn extract_time_constraints(opts: &Opts) -> Result<Vec<TimeFilter>> {
let mut time_constraints: Vec<TimeFilter> = Vec::new();
if let Some(ref t) = opts.changed_within {
if let Some(f) = TimeFilter::after(t) {
time_constraints.push(f);
} else {
return Err(anyhow!(
"'{}' is not a valid date or duration. See 'fd --help'.",
t
));
}
}View on GitHub (pinned to ee20f426dd)