Skip to content

adding empty file to zip leads to archive that can't be unzipped by windows #1597

@MrHacky

Description

@MrHacky
#include <sstream>
#include <fstream>

#include <Poco/Zip/Compress.h>

int main() {
	std::ofstream output("test.zip", std::ios::binary);
	Poco::Zip::Compress zip(output, true);
	std::stringstream empty;
	zip.addFile(empty, Poco::DateTime(), "emptyfile.txt");
	zip.close();
}

When trying to unzip the resulting zip files using windows' built-in zip handling support, i get to following error:

An unexpected error is keeping you from copying the file. If you continue to receive this error, you can use the error code to search for help with this problem.
Error 0x80004005: Unspecified error

I've tested this and got the same behavior in windows 7, 8, and 10.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions