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

  1. Run fd on a supported platform (Unix or Windows with GNU ls) when you need --list-details.
  2. Drop --list-details and post-process results yourself with the platform's native tooling.
  3. 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

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


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)