79724320

Date: 2025-08-03 21:12:45
Score: 1
Natty:
Report link

DotNetZip is now deprecated (with vulnerabilities), presumably in favor of System.IO.Compression.

However, neither ZipFile, nor ZipArchive have any way to add/update entries except via filename or stream. This works well for standard usage, but does not work well for the likes of ODF/ODS files (which are zip files). In particular, LibreOffice depends on having the manifest be the first file, but any update of a file using ZipArchive re-orders the file set and breaks LibreOffice (if the manifest is not first entry).

No-one on the interwebs seems to have run into this problem and the simplest work around I have figured, so far, is to extract the original odf/ods file to a temp folder, update the files as required, and then zip them back up into the, newly initialized, original odf/ods file (maintains the original create time).

Would be interested any simpler methods.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: klinkenbecker