zUnZipFiles Problems with Extracting Specific File
Keywords: error 11 zUnZipFiles
Question:
I have a test zip file that I'm working with that contains two text files, "0ser\Projects\WinBatch\RifTest\RifTest.txt" and "0ser\Projects\WinBatch\RifTest\RifTest2.txt". The zip file was created with zzipfiles with the default behaviour of storing full path names. I have tested the archive and extracted the files from Explorer.This line of code returns error 11 caution: file name not matched: f00 = zunzipfiles('', zipFile, 'RifTest.txt', '', TempDir) this gets the same error
f00 = zunzipfiles('',zipFile, '0ser\Projects\WinBatch\RifTest\RifTest.txt', '', TempDir)but this worksf00 = zunzipfiles('', zipFile, '*.txt', '', TempDir)Even tho I'm getting the files names from the archive before requesting the extraction I tried using the 'C' ignore case option but get the same results.Any help with this would be much appreciated.
Answer:
Note the behaviour of zUnZipFiles: either the docs need to be changed or the behavior:With zZipFiles this code works just fine:
f00 = zZipFiles('', zipFile, "0ser\Projects\WinBatch\RifTest\RifTest2.txt", '')but with zUnZipFiles, it doesn't like the backslashes. So I did the following and it resolved the error:F00eyFile = strreplace('0ser\Projects\WinBatch\RifTest\RifTest.txt', '\', '/') f00 = zunzipfiles('', zipFile, F00eyFile, '', TempDir)Works! No more error #11.
Article ID: W14816