fix: show "Directory ... created" instead of misleading byte size#944
Closed
mvanhorn wants to merge 1 commit intoouch-org:mainfrom
Closed
fix: show "Directory ... created" instead of misleading byte size#944mvanhorn wants to merge 1 commit intoouch-org:mainfrom
mvanhorn wants to merge 1 commit intoouch-org:mainfrom
Conversation
When unpacking archives, directory entries showed inconsistent and confusing messages: - zip: "File N extracted to path" (directories aren't files) - tar: "extracted (0 B) path" (0 B is misleading for directories) Both now show "Directory path created" for directory entries while keeping the existing "extracted (size) path" for regular files. Fixes ouch-org#328
Member
|
Hi! Great PR, but by a huge coincidence this change was just covered by this other PR: #937 That one came first so I'll prioritize that one, don't want to desincentivize improvements like this one tho, we very much appreciate these. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unifies directory output messages across tar and zip archive unpacking.
Why this matters
When unpacking archives, directory entries showed confusing output:
src/archive/zip.rs:56):"File 12 extracted to \"src/commands/\""- directories aren't filessrc/archive/tar.rs:83):"extracted (0 B) \"src/commands\""- the 0 B size is misleadingBoth should show the same clear message indicating a directory was created.
Changes
src/archive/zip.rs: Changed directory branch to print"Directory {path} created"instead of"File {idx} extracted to {path}"src/archive/tar.rs: Addedentry.header().entry_type().is_dir()check so directories print"Directory {path} created"while regular files keep the existing"extracted ({bytes}) {path}"formatTesting
cargo testpasses (13/13 tests). Snapshot updated forui_test_ok_decompress_multiple_files.Fixes #328
This contribution was developed with AI assistance (Claude Code).