I am creating zips using
System.IO.Compression.ZipFile.CreateFromDirectory(startPath,zipPath)
.
All is well on Windows afterwards - they unzip just fine. If I unzip these on MacOS (Mojave), the folder-structure is lost.
As an example, I have ziptest.zip with:
A/B/C/file1.txt
A/B/C/file1.txt
on MacOS (using context-menu's "Open with...Archive utility (Standard)", I get a folder ziptest
that contains the files A\B\C\file1.txt
and A\B\C\file2.txt
.
Looks as if the directory-separator is the problem. But I can't believe MS would have been so blind to miss this issue. (Although it seems common - I tried various cmdline-zippers and only SFK did it right...)
Is there an easy solution or is it truly a MS-bug? (And how can we get it fixed...?)
Update to answer Panagiotis' question: I'm on release 528040 which corresponds to 4.8. (Unfortunately it's no longer as easy as doing System.Environment.Version
, we're back to checking the registry...)