|
Post by Cobian on Sept 10, 2004 2:48:56 GMT -5
Hello!
Using VCLPro on D7.
I have created an archive with multimode mmBlocks. Everything works fine. But if trying to make a ZipAction:=zaUpdate or a ZipAction:=zaReplace, the last disc seems to be created twice. Foe example, when creating the non existing archive I get:
test.zip.z01 300000 kb test.zip.z02 300000 kb test.zip.z03 300000 kb test.zip 98000 kb (last disc)
after an Update or refresh I get
test.zip.z01 300000 kb test.zip.z02 300000 kb test.zip.z03 300000 kb test.zip.z04 98000 kb --> Same last disc test.zip 98000 kb (last disc)
Any ideas?
PS.- I also see that with mmBlocks zaUpdate seems to have no effect (everything is updated, even the files which have not be changed)
Regards
|
|
|
Post by Cobian on Sept 10, 2004 6:11:10 GMT -5
When debuging, I see that you use:
if (MultiZipInfo.MultiMode = mmBlocks) then begin // Last of split parts temporaryZipName := FZipNameNoExtension; DoFileNameForSplitPart(temporaryZipName,CurrentDisk+1,spLast); ZipName := temporaryZipName; RenameFile(tmpZipName, ZipName);<----- end
And this files under Windows (from the help file : If NewFile represents the name of an existing file, RenameFile behaves differently under Windows and Linux. Under Windows, the rename operation fails. Under Linux, RenameFile silently removes the other file.). This way I get having 2 last blocks.
I have solved this adding:
if FileExists(ZipName) then begin DeleteFile(ZipName); RenameFile(tmpZipName, ZipName); end;
This is the first part of the problem. The second problem I'm having is that the OnFileNameForSplitPart event is beeing called TWICE for the last block (one for the z04 file and then after the renaming to .zip) Must investigate this too..
|
|
|
Post by Cobian on Sept 10, 2004 6:36:08 GMT -5
Sorry, should be
if FileExists(ZipName) then DeleteFile(ZipName); RenameFile(tmpZipName, ZipName); //rename anyway
|
|
|
Post by Kevin on Sept 10, 2004 21:43:51 GMT -5
Unfortunately, no type of spanned zip file can be modified in anyway. This is just the nature of the spanned zip format. Trying to do so will pretty much corrupt the archive.
Kevin
|
|