UnixFileInfoCommand
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| FileInfoCommand anyenv.os_commands.base Base class for file info commands. |
â‹” Inheritance diagram¶
graph TD
3481821082["file_info.UnixFileInfoCommand"]
3903279879["base.FileInfoCommand"]
925645236["abc.ABC"]
2751680898["builtins.object"]
3903279879 --> 3481821082
925645236 --> 3903279879
2751680898 --> 925645236
🛈 DocStrings¶
Bases: FileInfoCommand
Unix/Linux 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 like %s, %F, etc.
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.
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 |