-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
System.IO.Compression.ZipFile: CreateEntriesFromDirectory #1546
Comments
If you want a directory with all of the items within that directory, you would need to return a list of ZipArchiveEntries. Also, entryName doesn't make much sense when you're adding multiple files unless you want that to be the base path for entries within the directory. I could see the usefulness of this. The implementation would be easily merge-able with the existing Though there is a simple solution when all files within the directory are at the root e.g.
it gets more complex when subfolders are involved as we have to calculate the relative paths for the entry names. Luckily, we already have a function for that. |
Yes, the return type could be changed to Given a directory structure on local storage
I can call the first overload with
The second overload would produce with
|
I think that makes sense, though
My vote would be to leave it out since we don't include it in any of the other extension methods.
The |
I changed it to
Well, I'd like to know why the parameter exists in method |
good call.
We've pretty well already made our bed with |
The method should be named It would be nice to have the |
I'm fine with that. Go ahead and include it and we'll see what the API reviewers think once we get it locked down. No need to add a differently-named method. |
Is there still API work needed? I would like to implement the proposed API. |
I think the API is good and we're at a reasonable place in the design discussion. The next step before moving forward is to wait for more support. We generally prefer to avoid adding API unless it's something that has wide support from the community or a very strong use-case that provides new functionality. Since this addition so far has neither, it's better to wait until the demand is more clear so that it can be better championed during the API review process. |
Triage: |
I found myself in need of this API today; is there anything else this proposal needs to be ready for review? |
Problem
When creating or updating zip archives there is no option to add a directory with its content. The content of a directory can only be added with custom code by hand.
ZipFile.CreateFromDirectory
is not an option when building complex zip archives.Proposed API
The text was updated successfully, but these errors were encountered: