Data models for OS command results.
CommandResult
dataclass
Base command result model.
Source code in src/anyenv/os_commands/models.py
| @dataclass
class CommandResult:
"""Base command result model."""
success: bool
exit_code: int = 0
output: str = ""
error: str = ""
|
CreateDirectoryResult
dataclass
Result for directory creation commands.
Source code in src/anyenv/os_commands/models.py
| @dataclass
class CreateDirectoryResult:
"""Result for directory creation commands."""
success: bool
path: str
created: bool = True
|
DirectoryEntry
dataclass
Directory entry model for detailed listings.
Source code in src/anyenv/os_commands/models.py
| @dataclass
class DirectoryEntry:
"""Directory entry model for detailed listings."""
name: str
path: str
type: Literal["file", "directory", "link"]
size: int
timestamp: str | None = None
permissions: str | None = None
|
ExistsResult
dataclass
Result for existence check commands.
Source code in src/anyenv/os_commands/models.py
| @dataclass
class ExistsResult:
"""Result for existence check commands."""
exists: bool
path: str
|
FileInfo
dataclass
File information model.
Source code in src/anyenv/os_commands/models.py
| @dataclass
class FileInfo:
"""File information model."""
name: str
path: str
type: Literal["file", "directory", "link"]
size: int
mtime: int | None = None
timestamp: str | None = None
permissions: str | None = None
|
RemovePathResult
dataclass
Result for path removal commands.
Source code in src/anyenv/os_commands/models.py
| @dataclass
class RemovePathResult:
"""Result for path removal commands."""
success: bool
path: str
removed: bool = True
|