Skip to content

Fix/ls cli - #42

Merged
hoshimura merged 5 commits into
fix_stale_native_buildfrom
fix/ls_cli
Oct 21, 2026
Merged

hoshimura merged 5 commits into
fix_stale_native_buildfrom
fix/ls_cli

Conversation

@hoshimura

Copy link
Copy Markdown
Collaborator

Align asanypath cli ls command with coreutils ls

@hoshimura
hoshimura added this pull request to stack #43 October 19, 2026 08:38
hoshimura and others added 4 commits October 21, 2026 10:43
Native S3/GCS/Azure listings now return (uri, is_dir, size, modified)
rows parsed from the list response itself, replacing the separate
*_is_dir_batch round-trips. A shared Rust Listing builder classifies
children and lets common prefixes win over same-named objects.

Python gains DirEntry and scandir(stat=...): each backend reports what
its listing knows (os.scandir d_type/stat locally, SFTP attrs, FTP MLSD
facts, Artifactory folder flags, cloud listing rows) and one shared step
probes only the missing fields, concurrently. Cloud walk() classifies
from the listing with no extra requests.

`asanypath ls` uses scandir for every mode: compact columns by default,
directories styled with a trailing "/", -l prints size and modified
time without the CREATED column, -r keeps the tree, and subtrees are
listed concurrently. On a 3,575-entry local directory, ls drops from
0.29s to 0.18s and ls -l from 0.74s to 0.21s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PROTOCOL_MAP now imports a built-in backend on first lookup of its scheme
instead of all at once, and registering a protocol before any lookup no
longer hides the built-ins. The package exports load on attribute access,
and the CLI defers rich.progress/live/table to the commands using them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
FTPPath.walk() built children from server-supplied names with
self / name, which decodes escapes such as %2E%2E, so a server could
make walk() and rglob() leave the walked directory. walk() now uses
_list_entries(), which keeps only direct children, and reports listing
failures to on_error as NotADirectoryError like the other backends.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hoshimura
hoshimura merged commit 2d150c2 into main Oct 21, 2026
8 checks passed
@hoshimura
hoshimura deleted the fix/ls_cli branch October 21, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants