|
 |
|
|
I tried to use your lib with a UNICODE project, but I could not compile with it. May you help me for this
Thanks in advance
Thuy
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I modified some codes, so that it can be used for a UNICODE program. Because the lib is fixed, it still can not be used for a UNICODE file name.
Any one need, pls contact me
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
A few weeks ago, I saw this nice code to wrap the ZLib/ZIP functionality in a comfortable way. Nearly everything works fine to zip folders and their subfolders together in one zip file. Only the XP unzipping feature has problems with subfolders in the zip files. Double clicking a zip file in windows XP starts the Extraction Wizard and during decompression a password should be entered for all files in subfolders. This behaviour does not appear while decompressing with other zip tools like WinZip or TotalCommander. Can anyone reproduce this problem or has a solution?
Stefan Frank
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
I've found the source code which produces the problem. In the method "CZipper::AddFolderToZip", the following code wants to generate a directory. I think this was a previous correction to store empty folders in the zip.
if (lstrlen(szFolderName)) { int nRet = zipOpenNewFileInZip(m_uzFile, szFolderName, &zfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION); zipCloseFileInZip(m_uzFile); }
I've commented it out, because I don't want to store empty folders and then the XP unzipping feature does not make any problems.
Stefan Frank
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi - I have been trying to use ZSEEK to set the file pointer as I need to "rewind" a bit, but without any luck. Does anyone have an example of how to do this? Paul
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
Hi,
Firstly, let me say a big THANK YOU for the code. It is very easy to use and extremely useful, especially considering the ugly raw interface of zlib.
Now to business. I am using the latest version of the CZipper class (downloaded from www.abstractspoon.com) and I noticed some weird behaviour.
I have a collection of files and folders in the root directory of the zip file and while some programs (e.g. WinZip) can use the resulting zip files without any problems, other programs (e.g. Google Earth) cannot. [In case you are wondering, I use CZipper to create Google Earth KMZ archives]. After a lot of debugging and frustration, I realised that the problem lies with the _alphabetical_ ordering of the files and folders in the zip archive. To be more precise, this works:root/ | |-- A/ => Folder A |-- Z/ => Folder Z |-- F => File F
This doesn't:root/ | |-- A/ => Folder A |-- B/ => Folder B |-- F => File F
The difference is the name of the file and the alphabeticaly last folder. If the name of the file is alphabetically AFTER the name of the last folder, the archive is not usable by some aplications.
Before you rush to accuse Google Earth for this weird behaviour, I also unzipped the file and rezipped it with WinZip, in which case Google Earth was more than happy to load it. This all points to a problem in the CZipper class, but I have been unable to locate the source of the problem.
Any help will be greatly appreciated! Many thanks.
-- /stokos
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Dan, Your code was really helpful Think you can post (or send me) the updated code ? (with the bug fixes mentioned in the comments)
Thanks,
Daniel C. [SDE, Sydney, AU] djc@walla.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Dang.
Thanks for the codes.
BTW I found that the unzip didn't work properly if the zipped file has more than one layer of subdir, i.e. the files under two layers of subdire could not be unzipped correctly. EG. myfile.zip with \*.* \sub1\*.* // no problem \sub1\sub2\*.* // having troubles
The unzip program of your other article "C++ wrapper for Gilles Vollant's Unzip API" works alright. But the check box of Ignore path information... not working. Checked or unchecked makes no difference.
Regards,
Ke
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
unzipping does not work. The unzip program of your other article "C++ wrapper for Gilles Vollant's Unzip API" works alright. But it does unzip a empty subdire in *.zip.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
Line 443 in Unzipper.cpp, *CHANGE* these:
if (!::CreateDirectory(szFolder, NULL)) return FALSE;
AS:
if (!::CreateDirectory(szFolder, NULL)) { DWORD dwRet = GetLastError(); if(dwRet != ERROR_ALREADY_EXISTS) return FALSE; }
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
I'm trying to generate an OpenOffice .odt file (a Zip file containing xml files) automatically.
If I zip up the files using IZArc or other Zip programs, I can open them in OpenOffice OK. If I use this class, OO complains that the file is corrupt. However, if I open the Zip file, extract the files and re-zip them using another program then they work fine in OpenOffice.
Any idea what's different between the zip files produced by this code and the zip files that IZArc and other programs produce?
|
| Sign In·View Thread·PermaLink | 2.67/5 (3 votes) |
|
|
|
 |
|
|
The last time I looked at this class, there was a problem with is using the wrong path separator character. The ZIP standard defines it as '/', but this class uses '\'.
Some archiver apps handle both '/' and '\' which is why you can open the archive in them, but I would guess that OO is more strict and only allows the '/'.
|
| Sign In·View Thread·PermaLink | 3.50/5 (2 votes) |
|
|
|
 |
|
|
Thanks for the suggestion. I got round it in the end by opening a zip file I created using another program and just using this class to add the main content file.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
Zipper.cpp: AddFolderToZip(LPCTSTR szFolderPath, bool bIgnoreFilePath) line 343 you can modify lstrcat(szFolderName, "\\"); to. lstrcat(szFolderName, "/");
-- modified at 5:30 Friday 3rd August, 2007
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
http://www.abstractspoon.com/ seems to contain a newer version with many fixes...
would be nice if these could be updated as well...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi. Thanks for this project. I like it. But I get these linking errors:
test error LNK2005: _exit bereits in msvcrtd.lib(MSVCR71D.dll) definiert test error LNK2005: __exit bereits in msvcrtd.lib(MSVCR71D.dll) definiert test error LNK2005: __cexit bereits in msvcrtd.lib(MSVCR71D.dll) definiert test error LNK2005: __c_exit bereits in msvcrtd.lib(MSVCR71D.dll) definiert test error LNK2005: ___xc_z bereits in msvcrtd.lib(cinitexe.obj) definiert test error LNK2005: ___xc_a bereits in msvcrtd.lib(cinitexe.obj) definiert test error LNK2005: ___xi_z bereits in msvcrtd.lib(cinitexe.obj) definiert test error LNK2005: ___xi_a bereits in msvcrtd.lib(cinitexe.obj) definiert test warning LNK4098: Standardbibliothek 'msvcrtd.lib' steht in Konflikt mit anderen Bibliotheken; /NODEFAULT:Bibliothek verwenden test warning LNK4098: Standardbibliothek 'LIBC' steht in Konflikt mit anderen Bibliotheken; /NODEFAULT:Bibliothek verwenden test warning LNK4098: Standardbibliothek 'msvcrt.lib' steht in Konflikt mit anderen Bibliotheken; /NODEFAULT:Bibliothek verwenden test fatal error LNK1169: Ein oder mehrere mehrfach definierte Symbole gefunden
Sorry for the german output, but it should basicly mean the same in english
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
|
 |
|
|
Hi, I had a problem with CUnzipper::Unzip below, when szFileName and szFolder had different root directories and the zip contained multiple empty intermediate directory levels (only subdirs, no files).
I used 2 steps to fix the problem:
a) in // static version bool CUnzipper::Unzip(LPCTSTR szFileName, LPCTSTR szFolder, bool bIgnoreFilePath) { CUnzipper unz;
if (!unz.OpenZip(szFileName)) return FALSE;
//MKinsert >> if(szFolder && strlen(szFolder)) unz.SetOutputFolder(szFolder); //<< MKinsert
return unz.UnzipTo(szFolder, bIgnoreFilePath); }
b) in bool CUnzipper::CreateFolder(LPCTSTR szFolder) { ... free(szPath);
//MKinsert >> dwAttrib = GetFileAttributes(szFolder); // already exists ? if (dwAttrib != 0xffffffff) return ((dwAttrib & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY); //<< MKinsert
if (!::CreateDirectory(szFolder, NULL)) return FALSE; ...
Hoping this may also help others  Regards Martin
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
why can't winzip open the created zip file, when I create a Sub-Folder(tried: \0\;\0;0\;0)? (sometimes WinRar can)
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Is there some way of using zlib (and your interface) to create zip files larger than 2Gig? There isn't any error but the zip file ends up being corrupted.
thx John
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
How do you append a zip file. I have tried the following:
zip.OpenZip(existing zip,NULL,TRUE);
When I do this the files already in the existing zip are removed and replaced by the files I was trying to append to the zip.
Thanks.
j
|
| Sign In·View Thread·PermaLink | 1.75/5 (3 votes) |
|
|
|
 |
|
|
 |
|
|
to specify the destination path you need to use the extended zip interface like this:
CZipper zip;
if (zip.OpenZip([dest folder + filename.zip])) { zip.AddFileToZip(...); zip.AddFileToZip(...);
zip.CloseZip(); }
rgds
.dan.g.
AbstractSpoon Software
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
The code assumes that paths are paths to physical devices. It fails to work with UNC paths.
Try zipping a directory with the path
\\server\drive\folder
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi!
Thks you for your code, it's very useful!
Is there a way to delete some file from an archive, or to replace a file by another one?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |