API¶
with_condition(condition: Callable[[os.DirEntry], bool], *, paths: list[str] | None = None, path: str | None = None, mode: int = os.F_OK | os.X_OK) -> list[str]
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
condition | Callable[[DirEntry], bool] | The condition used for searching. | required |
paths | list[str] | None | The list of paths to check. If | None |
path | str | None | The PATH to check, with each path separated by | None |
mode | int | The file mode used for checking access. | F_OK | X_OK |
Returns:
Type | Description |
---|---|
list[str] | A list of absolute paths to executables that satisfy the given condition. |
with_pattern(pattern: str | re.Pattern[str], *, paths: list[str] | None = None, path: str | None = None, mode: int = os.F_OK | os.X_OK) -> list[str]
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pattern | str | Pattern[str] | The pattern used for searching. | required |
paths | list[str] | None | The list of paths to check. If | None |
path | str | None | The PATH to check, with each path separated by | None |
mode | int | The file mode used for checking access. | F_OK | X_OK |
Returns:
Type | Description |
---|---|
list[str] | A list of absolute paths to executables that match the given pattern. |
with_prefix(prefix: str, *, paths: list[str] | None = None, path: str | None = None, mode: int = os.F_OK | os.X_OK) -> list[str]
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix | str | The prefix used for searching. | required |
paths | list[str] | None | The list of paths to check. If | None |
path | str | None | The PATH to check, with each path separated by | None |
mode | int | The file mode used for checking access. | F_OK | X_OK |
Returns:
Type | Description |
---|---|
list[str] | A list of absolute paths to executables that start with the given prefix. |