MacOSFileInfoCommand
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| FileInfoCommand anyenv.os_commands.base Base class for file info commands. |
⋔ Inheritance diagram¶
graph TD
2737525930["file_info.MacOSFileInfoCommand"]
3903279879["base.FileInfoCommand"]
925645236["abc.ABC"]
2751680898["builtins.object"]
3903279879 --> 2737525930
925645236 --> 3903279879
2751680898 --> 925645236
🛈 DocStrings¶
Bases: FileInfoCommand
macOS file info command implementation using ls -la.
Source code in src/anyenv/os_commands/file_info.py
create_command
¶
Generate ls -la command for file info.
Uses ls -la instead of stat to avoid shell expansion issues with format specifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to get information about |
required |
Returns:
| Type | Description |
|---|---|
str
|
The ls command string |
Source code in src/anyenv/os_commands/file_info.py
parse_command
¶
parse_command(output: str, path: str) -> FileInfo
Parse ls -la output for a single file/directory.
BSD ls output format is same as Unix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw ls -la command output |
required |
path
|
str
|
Original path requested |
required |
Returns:
| Type | Description |
|---|---|
FileInfo
|
FileInfo object with parsed information |