MCPcopy Create free account
hub / github.com/PerroEngine/Perro / read_dir

Function read_dir

perro_source/api_modules/perro_modules/src/file.rs:68–77  ·  view source on GitHub ↗
(path: P)

Source from the content-addressed store, hash-verified

66 matches!(perro_io::resolve_path(path), perro_io::ResolvedPath::Disk(pb) if pb.is_file())
67}
68
69pub fn read_dir<P: ResPathSource>(path: P) -> io::Result<Vec<String>> {
70 let path = path.as_res_path_str();
71 let root = disk_path(path)?;
72 let mut out = Vec::new();
73 for entry in fs::read_dir(root)? {
74 out.push(entry?.path().to_string_lossy().to_string());
75 }
76 out.sort();
77 Ok(out)
78}
79
80pub fn walk_dir<P: ResPathSource>(path: P) -> io::Result<Vec<String>> {

Callers 15

scan_innerFunction · 0.85
copy_dir_recursiveFunction · 0.85
merge_script_schema_dirFunction · 0.85
resolve_compiled_dylibFunction · 0.85
collect_csv_pathsFunction · 0.85
walk_dir_innerFunction · 0.85
walk_dirFunction · 0.85
walk_dirFunction · 0.85
collect_suffix_matchesFunction · 0.85

Calls 4

disk_pathFunction · 0.85
as_res_path_strMethod · 0.80
pushMethod · 0.45
pathMethod · 0.45

Tested by 2

merge_script_schema_dirFunction · 0.68