MCPcopy Index your code
hub / github.com/FSoft-AI4Code/HyperAgent / find_all_file_paths

Function find_all_file_paths

src/hyperagent/utils.py:530–546  ·  view source on GitHub ↗

Finds all paths of files with the given name in a parent folder. Args: parent_folder: The path to the parent folder. file_name: The name of the file to find. Returns: A list of all full paths to the files if found, otherwise an empty list.

(parent_folder, file_name)

Source from the content-addressed store, hash-verified

528 return None
529
530def find_all_file_paths(parent_folder, file_name):
531 """Finds all paths of files with the given name in a parent folder.
532
533 Args:
534 parent_folder: The path to the parent folder.
535 file_name: The name of the file to find.
536
537 Returns:
538 A list of all full paths to the files if found, otherwise an empty list.
539 """
540
541 file_paths = []
542 for root, _, files in os.walk(parent_folder):
543 if file_name in files:
544 file_paths.append(os.path.join(root, file_name))
545
546 return file_paths
547
548from pathlib import Path
549

Callers 2

_runMethod · 0.90
find_matching_file_pathFunction · 0.85

Calls 2

appendMethod · 0.80
walkMethod · 0.45

Tested by

no test coverage detected