Archived Forum Post

Index of archived forum posts

Question:

zip2 Issue

Sep 09 '13 at 08:39

I am using 9.4.1.26 of the Zip2 ActiveX library in Visual FoxPro 9. For some reason, I cannot set the AppendFromDir and PathPrefix properties. Whatever I set them to, they are being ignored. I am using a number of other libraries without any problems but this is my first time with this library. Any ideas please?

Here is my code:

loZip = CreateObject('Chilkat.Zip2')
loZip.UnlockComponent("Anything for 30-day trial")
loZip.NewZip("d:test.zip")
loZip.PathPrefix = "z_pdf/"
loZip.AppendFromDir = "d:/data"
loZip.AppendFiles("z_pdf/*",1)

Here are details from the error log produced:

FilePattern: z_pdf/*
AppendFromDir: .
PathPrefix: 
BaseDir: C:\Program Files (x86)\Microsoft Visual FoxPro 9\z_pdf\
InzipBase: z_pdf/
FilenamePart: *
IsSpecificFile: 0
recurse: 1
saveExtraPath: 0
archiveOnly: 0
includeHidden: 1
includeSystem: 1
ignoreAccessDenied: 1
filePath: \\?\C:\Program Files (x86)\Microsoft Visual FoxPro 9\z_pdf\*
filePath2: C:\Program Files (x86)\Microsoft Visual FoxPro 9\z_pdf\*
FindFirst on sub-directory failed.
dir: C:\Program Files (x86)\Microsoft Visual FoxPro 9\z_pdf\*
winError: The system cannot find the path specified.
Failed to add files, source directory may not exist..

--AppendFilesEx --ChilkatLog


Answer

The LastErrorText you provided does not seem to match with your code fragment. In the LastErrorText, the PathPrefix is shown as being empty:

FilePattern: z_pdf/
AppendFromDir: .
PathPrefix:
BaseDir: C:Program Files (x86)Microsoft Visual FoxPro 9z_pdf
InzipBase: z_pdf/
FilenamePart: 
IsSpecificFile: 0
recurse: 1
I tested it, and my LastErrorText looks like this:
    FilePattern: z_pdf/*
    AppendFromDir: c:/temp
    PathPrefix: z_pdf/
    BaseDir: c:tempz_pdf
    InzipBase: z_pdfz_pdf


Answer

That's the issue I am having. The error log is definitely produced by that code. Although I am setting in code the properties such as PathPrefix, they are not being registered but seem to be ignored.


Answer

Hi, Any ideas on this? It is driving me up the wall. Just to give a bit more information, if I set loZip.DiscardPaths = 1, the pathprefix is used. However, all the paths for the recursed files are lost so this does not really help. If you need any further information from me then please let me know. You help in getting a solution would be most appreciated.