Find all elements in root that begin with the prefix, case-insensitive.
(root: Path, prefix: str)
| 170 | |
| 171 | |
| 172 | def find_prefixed(root: Path, prefix: str) -> Iterator[os.DirEntry[str]]: |
| 173 | """Find all elements in root that begin with the prefix, case-insensitive.""" |
| 174 | l_prefix = prefix.lower() |
| 175 | for x in os.scandir(root): |
| 176 | if x.name.lower().startswith(l_prefix): |
| 177 | yield x |
| 178 | |
| 179 | |
| 180 | def extract_suffixes(iter: Iterable[os.DirEntry[str]], prefix: str) -> Iterator[str]: |
no outgoing calls
no test coverage detected