is_file
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| MacOSIsFileCommand anyenv.os_commands.is_file macOS is file command implementation. |
||
| UnixIsFileCommand anyenv.os_commands.is_file Unix/Linux is file command implementation. |
||
| WindowsIsFileCommand anyenv.os_commands.is_file Windows is file command implementation. |
🛈 DocStrings¶
Is file command implementations for different operating systems.
MacOSIsFileCommand
¶
Bases: IsFileCommand
macOS is file command implementation.
Source code in src/anyenv/os_commands/is_file.py
create_command
¶
Generate test -f command (same as Unix).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to test if it's a file |
required |
Returns:
| Type | Description |
|---|---|
str
|
The test command string |
parse_command
¶
Parse test -f result based on exit code (same as Unix).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output (ignored) |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
True if path is a file, False otherwise |
Source code in src/anyenv/os_commands/is_file.py
UnixIsFileCommand
¶
Bases: IsFileCommand
Unix/Linux is file command implementation.
Source code in src/anyenv/os_commands/is_file.py
create_command
¶
Generate Unix test -f command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to test if it's a file |
required |
Returns:
| Type | Description |
|---|---|
str
|
The test command string |
parse_command
¶
Parse Unix test -f result based on exit code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output (ignored) |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
True if path is a file, False otherwise |
Source code in src/anyenv/os_commands/is_file.py
WindowsIsFileCommand
¶
Bases: IsFileCommand
Windows is file command implementation.
Source code in src/anyenv/os_commands/is_file.py
create_command
¶
Generate PowerShell file test command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to test if it's a file |
required |
Returns:
| Type | Description |
|---|---|
str
|
The PowerShell command string |
Source code in src/anyenv/os_commands/is_file.py
parse_command
¶
Parse PowerShell file test result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw PowerShell command output |
required |
exit_code
|
int
|
Command exit code (ignored) |
0
|
Returns:
| Type | Description |
|---|---|
bool
|
True if path is a file, False otherwise |