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

Thrown in src/main.rs:489 by the list-details builder for any target that is neither cfg(unix) nor cfg(windows) — for example wasm32, redox, or a custom target. fd has no ls invocation path for such platforms, so --list-details is hard-unsupported.

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 41532d114e)

Solutions

  1. Do not use --list-details on this target; use plain 'fd' output and post-process with whatever stat-like tool the platform offers.
  2. Rebuild fd for a supported target (unix or windows) if you need this option.
  3. File a feature request to add a platform-specific ls wrapper for the target.
Defensive patterns

Strategy: fallback

Validate before calling

# only attempt --list-details on unix/windows
if [ "$(uname -s)" = Linux ] || [ "$(uname -s)" = Darwin ] || echo "$OS" | grep -qiE 'win'; then
  fd --list-details "$@"
else
  echo "--list-details unsupported here" >&2; fd "$@"
fi

Prevention

When it happens

Trigger: Running a fd build target whose cfg is neither unix nor windows and invoking 'fd --list-details'.

Common situations: Cross-compiling/running fd under wasm or an exotic RTOS; a tier-3 target where the unix/windows cfg branches are both off.

Related errors


AI-assisted analysis of sharkdp/fd@41532d114e (2026-08-06). Data as JSON: /data/errors/af990c7e969e9101.json. Report an issue: GitHub.