DotNetZip creates zip files with permission 000 (no read, no write, no execute) and thus I cannot easily open them on Linux (Windows Explorer doesn't care about it and opens the file normally). Same code on Windows produces files with read permission (on Linux):
using (var fs = new System.IO.FileStream("./test.zip"))
{
using (var archive = new System.IO.Compression.ZipArchive(fs, ZipArchiveMode.Create))
{
var entry = archive.CreateEntry("test.txt");
using (var writer = new System.IO.StreamWriter(entry.Open()))
{
writer.Write("Hello World");
}
}
}
Can I either set the permissions or emulating that System.IO.Compression
is running on Windows?