Cannot rename file in zip from pigz
A free file archiver for extremely high compression
Brought to you by:
ipavlov
It happened to me when I was testing something and wanted to quickly make zip with pigz.. File was named '-' and when I tried to rename it with 7zip it failed.
Here is a script that shows it:
$ echo aaaaaa > a
$ zip zip.zip a
$ 7z rn zip.zip a b
(...)
Updating archive: zip.zip
Items to compress: 0
Files read from disk: 0
Archive size: 158 bytes (1 KiB)
Everything is Ok
$ pigz -K -k a
$ mv a.zip pigz.zip
$ 7z rn pigz.zip a b
Updating archive: pigz.zip
Items to compress: 0
System ERROR:
E_NOTIMPL
As you can see zip file created with zip works, zip file created with pigz doesn't . What is even more surprising, test ($ 7z t pigz.zip
) is ok.
It maybe a problem with pigz, maybe with 7zip. I don't know. They follow somewhat strange specs or something, for example zip.zip starts with 50 4B 03 04 │ 14
, pigz.zip starts with 50 4B 03 04 │ 2D
.
That zip archive uses descriptor (stream mode compression).
7-Zip doesn't allow to rename such items by some reasons.
Descptor case has no good specification in zip format.
So diffirent ways to implement it are possible. And if we update such archive, we can broke zip archive, because we don't know what exact way was used to create discriptor records in archive.
So 7-Zip just doesn't allow rename operations for descptor cases.
zip specification:
The problem in this specification statement:
ZIP files MAY be encountered with or without this signature
.So we don't know for 100% what exact size of descriptor record.
We can try to detect size of descriptor record with additional code, but it's not safe for 100% still, and it was not implemented in 7-zip.
Last edit: Igor Pavlov 2023-10-22
Understood.
Not a bug then.
Can be closed.
Last edit: Sam Tansy 2023-11-07