Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default System.IO.Compression.ZipFile CompressionLevel value?

Tags:

c#

zip

I'm making a zip file using

ZipFile.CreateFromDirectory(DeployDirectory, ZipDirectory + @"\DatabaseDeploy.zip", CompressionLevel.Fastest, true);

I want to include the base directory so I need the overload that takes a CompressionLevel value as third argument. But I don't care about that, I just want it to work the same way as for the overload that just takes string, string.

Anyone knows?

like image 928
magnusarinell Avatar asked Feb 25 '16 13:02

magnusarinell


People also ask

What is System IO compression ZipFile?

ZipFile.Open Method (System.IO.Compression) Opens a zip archive at the specified path and in the specified mode.

How do I add a system IO compression reference?

Just go to References and add "System. IO. Compression.


1 Answers

CompressionLevel.Optimal, for now at least. You could also probably set the argument to null to get the default behavior, even if it changes in the future.

https://github.com/dotnet/runtime/blob/d110d7dd976b36787af31f82644031a20cf50094/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs#L623

like image 179
cham Avatar answered Jan 03 '23 16:01

cham