Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple files with same name #562

Open
abuzzell opened this issue Aug 28, 2023 · 1 comment
Open

Multiple files with same name #562

abuzzell opened this issue Aug 28, 2023 · 1 comment
Assignees
Labels

Comments

@abuzzell
Copy link

If I try to add two files, both called test.txt, but each with different content, rubyzip produces an archive with only 1 file, the last one added via put_next_entry.

Given the underlying IO implementation in the output stream handler, it's not obvious to me that name collision should be a problem. And standard zip libraries do allow this, albeit though it's an unusual case.

The maintainers might believe this is working as intended, but I think it's surprising behaviour and that at least a warning should be generated. But I also think a case could be made for accepting multiple files with the same name.

@hainesr hainesr self-assigned this Feb 24, 2024
@hainesr hainesr added the bug label Feb 24, 2024
@hainesr
Copy link
Member

hainesr commented Feb 24, 2024

Hi @abuzzell,

Thanks for reporting this. Yes, the ZIP specification allows for multiple entries with the same name. I can see why rubyzip isn't allowing this, so I'll mark this as a bug to be fixed.

Note to my future self: the ZIP spec doesn't explicitly say that there can be multiple entries with the same name, but it certainly doesn't rule it out either, and there's evidence (here and plenty of other places) that this is expected behaviour. Definitely a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants