Skip to main content

luaur_cli_lib/functions/
traverse_directory_file_utils.rs

1pub fn traverse_directory_mut(path: &str, callback: &dyn Fn(&str)) -> bool {
2    // Faithful to FileUtils.cpp `traverseDirectory`. Both platforms route to the
3    // byte-path recursive helper: its POSIX branch walks via `std::fs::read_dir`
4    // and its Windows branch via `FindFirstFileW` (correctly NUL-terminating the
5    // search path). The previous Windows route went to a wstring helper that was
6    // only a stub (returned `false`, never enumerated), so directory traversal
7    // silently did nothing on Windows.
8    use crate::functions::traverse_directory_rec_file_utils_alt_b::traverse_directory_rec_string_function_void_const_string_name;
9
10    traverse_directory_rec_string_function_void_const_string_name(path, callback)
11}