|
Post by holger on Sept 21, 2009 3:26:57 GMT -5
If I unzip a zip containing sub folders VCLUnzip raises errors. In the OnStartUnzip-function I see that in FName a slash '/' is used as path separator, not the correct backslash '\' (I use VCLZipPro451 beneath C++ Builder 6)
|
|
|
Post by Kevin on Sept 21, 2009 9:24:27 GMT -5
I am not seeing this but I will look at it a little more closely and get back.
Kevin
|
|
w2m
New Member
Posts: 27
|
Post by w2m on Sept 21, 2009 10:55:12 GMT -5
I have been extracting files with sub-folders for some time now in Delphi 2009 and Delphi 2010. I have never seen improper slashes that I can remember.
Bill
|
|
|
Post by Kevin on Sept 21, 2009 12:01:47 GMT -5
Paths are actually stored with forward slashes internally in a PKZip file but they are always converted right away when read from the zip file. I'm not sure why they would be showing up that way but I am not where I can check the code right now so I will do some checking later today.
One question, were the zip files that you are working with created by VCLZip? If not, what zip utility were they created with?
Thanks!
Kevin
|
|
w2m
New Member
Posts: 27
|
Post by w2m on Sept 21, 2009 12:24:52 GMT -5
I am not sure if this helps but I just tested creating a zip file with SecureZIP, PKWARE'successor to PKZIPĀ®, the original ZIP compression and archiving program.
SecureZIP stored paths as Icons/ but when I opened the file with VCLZip the paths were converted to Icons\. The folder paths were sucesfully created when the files were extracted with VCLZip.
Bill
|
|
|
Post by Kevin on Sept 21, 2009 17:59:29 GMT -5
Hi Holger,
VCLZip definitely converts the forward slashes to backwards slashes for each filename as soon as it is read in from the archive and I can't find a way, so far, to re-create the problem.
1. Did VCLZip also create the archives? If not, what did?
2. Would it be possible for you to send me a sample zip file that is causing this problem? Send to support @ vclzip.com.
Thanks,
Kevin
|
|
|
Post by holger on Sept 22, 2009 2:39:30 GMT -5
Kevin, in my application I also use the TNT Unicode Library, you know? Unfortunately some of your classes in kpUnicode.pas has a name conflict with this library. Therfore I have to rename some of your classes eg. TWideStrings to TkpWideStrings. It sounds this is the reason of my problems.
Could you tell me in which unit/function the replacement '/' to '\' is done. I could debug to see why it don't works on my side.
Thanks, Holger
|
|
|
Post by holger on Sept 22, 2009 3:36:19 GMT -5
I've found it! function UnixToDOSFilename(fn: kpPChar): kpPChar;Because I use BCB6, I could not really debug Delphi code. So I can't see the content of fn. If I add the line: ShowMessage(PCharToStr(fn)); I get messages starting with ' ??' like: '??st1.z' The function UnixToDOSFilename jumps to kpStrScan and then to StrScanW. So far it looks good, but the result is the same. Any Hints? Holger
|
|
|
Post by Kevin on Sept 22, 2009 6:23:13 GMT -5
Yes, that is where the slashes are converted. Are you compiling with the conditional IMPLEMENT_UNICODE defined in the VCLZip package? That is defined by default in the VCLZip package which causes VCLZip to compile all (almost all) strings to be widestrings. If not defined, all strings are normal strings. If you have compiled with IMPLEMENT_UNICODE then your parameters for the OnStartZip and OnStartUnZip should be widestrings for filename and when you do a showmessage you will need to use TNT's showmessage to see what is really in the filename.
Could this be the problem or part of it? That you are just seeing the data wrong due to the widestring/string conflicts in ShowMessage and in debug also? I have found that debug also will not always show widestring values correctly, especially if Unicode is involved.
|
|
|
Post by holger on Sept 23, 2009 2:50:12 GMT -5
Kevin, good news for you: It works at a new computer without TNT-Tools.
Unfortunately my main project is TNT-based. Maybe my changes at VCLZip to get it compile together with TNT causes the errors. Do you have any idea to get it compiling with TNT?
Regards, Holger
|
|
|
Post by Kevin on Sept 23, 2009 6:28:06 GMT -5
I still need to know whether you are compiling with IMPLEMENT_UNICODE defined in the package. Open up the VCLZip package in the package editor and look at the conditionals and see if that is defined.
Compiling with or without TNT controls should not make a difference unless somewhere you might be using a string when you think you are using a widestring or something like that.
It's possible if you have not compiled VCLZip with IMPLEMENT_UNICODE yet you are using TNT that you might be passing widestrings into VCLZip which is using Strings in that case.
Kevin
|
|
|
Post by holger on Sept 23, 2009 6:59:52 GMT -5
Sorry, I've checked this already yesterday: IMPLEMENT_UNICODE is defined in VCLZipBCB6.bpk.
The problem is, that some classes and functions are defined in kpUnicode.pas as well as in TntClasses.pas. (eg. WideStrings, IntToStrW etc.) The compiler raises an exception, that he don't know which function he has to use.
Holger
|
|
|
Post by Kevin on Sept 23, 2009 10:02:02 GMT -5
I don't think VCLZip has this problem internally. I have not run into this problem with apps I have created, but I probably specify where to call.
In your own code you should be able to add the proper module name to the call where there are conflicts, like tntmodule.IntToStrW(...), where tntmodule is whatever TNT module it's IntToStrW is in. Will that resolve the problem for you?
|
|