Skip to main content

recursivecmd

Function recursivecmd 

Source
pub fn recursivecmd<P, R, L>(
    nam: &str,
    opt_noerr: i32,
    opt_recurse: i32,
    opt_safe: i32,
    args: &[String],
    dirpre_func: P,
    dirpost_func: R,
    leaf_func: L,
) -> i32
where P: Fn(&str, &str, Option<&Metadata>) -> i32, R: Fn(&str, &str, Option<&Metadata>) -> i32, L: Fn(&str, &str, Option<&Metadata>) -> i32,
Expand description

Direct port of recursivecmd(char *nam, int opt_noerr, int opt_recurse, int opt_safe, char **args, RecurseFunc dirpre_func, RecurseFunc dirpost_func, RecurseFunc leaf_func, void *magic) from Src/Modules/files.c:378. C body (c:381-446): walk argv, dispatch each via recursivecmd_doone. The dirsav-based chdir-back stack (c:396-399, c:438-446) is omitted in the Rust port — std::fs operations take absolute paths so the chdir dance C uses to safely descend isn’t needed. WARNING: param names don’t match C — Rust=(opt_noerr, opt_recurse, opt_safe, args, dirpre_func, dirpost_func, leaf_func) vs C=(nam, opt_noerr, opt_recurse, opt_safe, args, dirpre_func, dirpost_func, leaf_func, magic)