list_directory
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| MacOSListDirectoryCommand anyenv.os_commands.list_directory macOS list directory command implementation. |
||
| UnixListDirectoryCommand anyenv.os_commands.list_directory Unix/Linux list directory command implementation. |
||
| WindowsListDirectoryCommand anyenv.os_commands.list_directory Windows list directory command implementation. |
🛈 DocStrings¶
List directory command implementations for different operating systems.
MacOSListDirectoryCommand
¶
Bases: ListDirectoryCommand
macOS list directory command implementation.
Source code in src/anyenv/os_commands/list_directory.py
create_command
¶
Generate BSD ls command (no --time-style support).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory path to list |
''
|
Returns:
| Type | Description |
|---|---|
str
|
The ls command string |
Source code in src/anyenv/os_commands/list_directory.py
parse_command
¶
parse_command(output: str, path: str = '') -> list[DirectoryEntry]
Parse BSD ls output (same as Unix).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw ls command output |
required |
path
|
str
|
Base directory path |
''
|
Returns:
| Type | Description |
|---|---|
list[DirectoryEntry]
|
List of DirectoryEntry objects |
Source code in src/anyenv/os_commands/list_directory.py
UnixListDirectoryCommand
¶
Bases: ListDirectoryCommand
Unix/Linux list directory command implementation.
Source code in src/anyenv/os_commands/list_directory.py
create_command
¶
Generate Unix ls command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory path to list |
''
|
Returns:
| Type | Description |
|---|---|
str
|
The ls command string |
parse_command
¶
parse_command(output: str, path: str = '') -> list[DirectoryEntry]
Parse Unix ls output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw ls command output |
required |
path
|
str
|
Base directory path |
''
|
Returns:
| Type | Description |
|---|---|
list[DirectoryEntry]
|
List of DirectoryEntry objects |
Source code in src/anyenv/os_commands/list_directory.py
WindowsListDirectoryCommand
¶
Bases: ListDirectoryCommand
Windows list directory command implementation.
Source code in src/anyenv/os_commands/list_directory.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
create_command
¶
Generate Windows PowerShell dir command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory path to list |
''
|
Returns:
| Type | Description |
|---|---|
str
|
The PowerShell command string |
Source code in src/anyenv/os_commands/list_directory.py
parse_command
¶
parse_command(output: str, path: str = '') -> list[DirectoryEntry]
Parse Windows PowerShell Get-ChildItem output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw PowerShell command output |
required |
path
|
str
|
Base directory path |
''
|
Returns:
| Type | Description |
|---|---|
list[DirectoryEntry]
|
List of DirectoryEntry objects |