无法让 zip_utils 处理 gzip 文件
Trouble getting zip_utils to work with gzip files
我正在使用 zip_utils。
https://www.codeproject.com/Articles/7530/Zip-Utils-Clean-Elegant-Simple-Cplusplus-Win
我让它可以处理 zip 文件,但我无法压缩任何 .gz (gzip) 文件。文档(见上文)似乎表明它应该有效。这是我使用的代码:
HZIP hz = OpenZip(sourcePath.c_str(), 0);
SetUnzipBaseDir(hz, dir.c_str());
ZIPENTRY ze; GetZipItem(hz, -1, &ze); int numitems = ze.index; // -1 gives overall information about the zipfile
for (int zi = 0; zi < numitems; zi++)
{
ZIPENTRY ze; GetZipItem(hz, zi, &ze); // fetch individual details
UnzipItem(hz, zi, ze.name); // e.g. the item's name.
//UnzipItem(hz, zi, destPath.c_str());
}
CloseZip(hz);
我看不到任何迹象表明该库将处理 gzip 文件。
我正在使用 zip_utils。
https://www.codeproject.com/Articles/7530/Zip-Utils-Clean-Elegant-Simple-Cplusplus-Win
我让它可以处理 zip 文件,但我无法压缩任何 .gz (gzip) 文件。文档(见上文)似乎表明它应该有效。这是我使用的代码:
HZIP hz = OpenZip(sourcePath.c_str(), 0);
SetUnzipBaseDir(hz, dir.c_str());
ZIPENTRY ze; GetZipItem(hz, -1, &ze); int numitems = ze.index; // -1 gives overall information about the zipfile
for (int zi = 0; zi < numitems; zi++)
{
ZIPENTRY ze; GetZipItem(hz, zi, &ze); // fetch individual details
UnzipItem(hz, zi, ze.name); // e.g. the item's name.
//UnzipItem(hz, zi, destPath.c_str());
}
CloseZip(hz);
我看不到任何迹象表明该库将处理 gzip 文件。