MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / walk_files

Method walk_files

atomic-core/src/output/filesystem/walk.rs:42–53  ·  view source on GitHub ↗

Walk the directory tree recursively. Yields all files (not directories) under the given path, respecting ignore patterns. The `.atomic` directory is always excluded.

(&self, path: &str)

Source from the content-addressed store, hash-verified

40 /// Yields all files (not directories) under the given path, respecting
41 /// ignore patterns. The `.atomic` directory is always excluded.
42 pub fn walk_files(&self, path: &str) -> io::Result<Vec<String>> {
43 let abs_path = if path.is_empty() {
44 self.root().to_path_buf()
45 } else {
46 self.resolve_path(path)?
47 };
48
49 let mut files = Vec::new();
50 self.walk_files_recursive(&abs_path, &mut files)?;
51 files.sort();
52 Ok(files)
53 }
54
55 /// Recursive helper for walk_files.
56 fn walk_files_recursive(&self, dir: &Path, files: &mut Vec<String>) -> io::Result<()> {

Callers 8

collect_working_filesFunction · 0.45
detect_changes_simpleFunction · 0.45
test_walk_files_emptyFunction · 0.45
test_walk_files_simpleFunction · 0.45
test_walk_files_nestedFunction · 0.45
test_walk_files_sortedFunction · 0.45

Calls 5

walk_files_recursiveMethod · 0.80
sortMethod · 0.80
is_emptyMethod · 0.45
rootMethod · 0.45
resolve_pathMethod · 0.45

Tested by 6

test_walk_files_emptyFunction · 0.36
test_walk_files_simpleFunction · 0.36
test_walk_files_nestedFunction · 0.36
test_walk_files_sortedFunction · 0.36