...the first problem have been Memory Errors when executing PureZIP_DeleteFile when the archive is not in a proper format (no problems have been seen with all other commands) - workaround extracting and compacting all files to create a compatible archive.
...but now I am still not able to remove the file in the sub directory and so I get multiple files with the same name in the archive. Is there a simple method to overwrite an existing file?
Code: Select all
Archiv.s="Test.zip"
Datei.s="subdir\file.txtl"
Global Buffer.s
Global Ok.i
If PureZIP_Archive_Read(Archiv)
myfileinfo.PureZIP_FileInfo
If PureZIP_Archive_Locate(Datei)=#UNZ_OK
Buffer=Space(myFileinfo\unCompressedSize)
If PureZIP_Archive_ExtractMem(@Buffer,Len(Buffer))>0
Buffer=Left(Buffer,123)+"***"+Mid(Buffer,123)
Ok=1
EndIf
EndIf
PureZIP_Archive_Close()
EndIf
If Ok
Debug PureZIP_DeleteFile(Archiv,Datei)
If PureZIP_Archive_Create(Archiv,#APPEND_STATUS_ADDINZIP)
Debug PureZIP_Archive_CompressMem(Datei,@Buffer,Len(Buffer)-1)
PureZIP_Archive_Close()
EndIf
EndIf