-
Notifications
You must be signed in to change notification settings - Fork 39
Add support for Zip64 for archives > 4GB #19
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
Comments
@SteveL-MSFT Do you have in mind that we need to use this project SharpZipLib? |
@iSazonov since SharpZipLib appears to be available under MIT License, I see no reason to not use that lib. |
@SteveL-MSFT Thanks! |
This is a pain point compress-archive, which I was looking to make use of for Zipping up Process dumps (some 7Gb +) but it looks like I'd be better wrapping around 7zip to do this instead of relying on a more native command. |
Looks like SharpZipLib now has NetStandard1.3 support so that works for us |
@SteveL-MSFT is there any update on this at all? |
@kilasuit no update right now, it's in the backlog, but not a high priority right now given other work that's happening |
@kilasuit FYI: There is a preexisting 7zip wrapper available as a temporary workaround / to save you rolling your own. https://github.com/thoemmi/7Zip4Powershell |
I can't find a corefx issue for this? Is this something we should open an issue on them for? Some possibly related issues: |
@rjmholt I think rewriting this module in C# and using SharpZipLib might be better than waiting for corefx, plus it would work for older versions of PowerShell |
@SteveL-MSFT agreed, but just want corefx to be conscious of the ask |
@rjmholt no harm in opening an issue for corefx. I suspect it's not high on their priority since existing OSS libraries support zip better than the built in support unless ASPNETCORE has a need for it. |
Any update on where this is at? |
@adam-birds-hwt unfortunately, this is currently not in our priority queue. I'd like to see about addressing this in PS7.1 timeframe as it's not a small work item. |
Hi, same issue on windows Server 2016/2019 |
This comment says that .Net support Zip64. @ericstj or @ianhays could tell us (please) where a problem is in this module and that API we could use to re-write the module on C#. |
The implementation in .NETCore still loads into memory when being opened for update. When it does this it uses a managed array which limits the size to 2GB. If you open only the archive for Read or Write only, then entries can be created that exceed 2GB. Let us know more about the scenario and we can provide a recommendation. /cc @carlossanlop |
@adityapatwardhan does the archive module perform archive update/modification functions? |
@rjmholt Yes, it is does. If MSFT approves I'd port the module to C# (in PowerShell/Module repo) and address the issue too. |
@SteveL-MSFT and @adityapatwardhan are probably the right people to make that call |
Any status update on this, and #96? It would be great to not have to build some custom Advanced Function to handle archives, or worse yet to use an external binary (like 7z.exe). |
we waiting for creating of ZIP archives almost for 4 years ... it is sad. :( |
In .Net 5.0 I still see issues in the API. We need investigate in depth all issues in the API and ask .Net team to fix its in .Net 6.0 milestone. |
I'd like to emphasize that the file size limitation of compress archive has a renewed sense of urgency now that applications like 7zip are being banned from government and DOD systems and there's no CLI replacement really available outside of third party. It would be preferable for a native application to be implemented. Or simply incorporate gzip or tar since they're fully featured already. |
@Bearstonk - I believe that this is semi-planned in the PowerShell Roadmap post by @SteveL-MSFT due to the Exec Order on CyberSecurity. How soon this happens will be a different matter that only Steve can properly comment on. |
Closing this issue as zip64 is now supported. |
Please download the latest preview for zip64 support. |
@ayousuf23 Could you give me more context, what does it mean to download latest preview for zip64? |
For all the ones that ended up here I found a solution without upgrading to the just released (4 days ago) preview version .NET Framework 4.8.1. Then in your powershell you go to the folder where is your downloaded script and execute the following command: And you should get something like this: Documentation: |
@JairoCaychoFinTech what @ayousuf23 meant was with the latest preview of this module you now get zip64 support, which the release of it on the PowerShellGallery does show install instructions |
Thanks for the clarification. I'm just starting with scripting so I need a lot of explanations! |
For anyone still facing this issue and wanting to use a PowerShell / .NET native solution, I created this function. It is fully compatible with PowerShell 5.1 and PowerShell Core and there shouldn't be a file size limitation because it doesn't use a |
I've just tried this on a 3.7GB file and it cuts the original file short as the CopyTo has the same Stream was too long issue. The archive completes but only with 2GB of the original file. |
@NRL-LEastham I'm honestly unable to replicate. Have tried to compress folders with size up to 20Gb without any problems. Are you using the latest module version |
Sorry was against the clock on Friday. I ended up just using a function call that adds the switches to the command line of the installed 7z CLI. Was on the latest version and my 3.7gb T-SQL file just generated the stream error on a CopyTo command instead. Was a 2 vCore 8GB VM and although the zip was created the original file size was reported as 2.7GB instead so must have truncated. If I get time I'll test on my local machine and if still an issue will raise it on your repo. |
The .Net ZipFile class currently has a limitation of 2GB sizes, this limits usefulness on VM scenarios where VHDs are routinly larger than 2 GB
The text was updated successfully, but these errors were encountered: