PDA

View Full Version : Help with ZIP PLUGIN


DarrellBlack
03-21-2005, 07:15 AM
All I could use some help understanding why my ZIP files do not preserve the Path Name. Code below:

--read in user selected folder to archive--
sFolder = Dialog.FolderBrowse("Select Test to Archive", ""..sLastInstalledPath.."\\data")
--read in all files names into table--
tFolder = File.Find(""..sFolder.."", "*.*", true, true)
Debug.ShowWindow(true)
Debug.Print(""..tFolder[1].."\n")
Debug.Print(""..tFolder[2].."\n")
Debug.Print(""..tFolder[3].."\n")
Debug.Print(""..tFolder[4].."\n")
Debug.Print(""..tFolder[5].."\n")
Debug.Print(""..tFolder[6].."\n")
--used to find test name--
sFileCOUNT = String.Length(sFolder)
sFileSTART = String.ReverseFind(sFolder, "\\", false)
sZIPFILELENGTH = sFileCOUNT - sFileSTART
sFile = String.Right(sFolder, sZIPFILELENGTH)
--zip all selected files--
Zip.Add(SessionVar.Expand("%DesktopFolderCommon%\\"..sFile..".zip"), tFolder, true, "", 9, nil, true);

--OUTPUT FROM DEBUG WINDOW--
C:\dts_tdas\data\20189 01 Static\NHTSA
C:\dts_tdas\data\20189 01 Static\NHTSA\UDS
C:\dts_tdas\data\20189 01 Static\NHTSA\UDS\20189 01 STATIC_UDS.001
C:\dts_tdas\data\20189 01 Static\NHTSA\UDS\20189 01 STATIC_UDS.002
C:\dts_tdas\data\20189 01 Static\NHTSA\UDS\20189 01 STATIC_UDS.003
C:\dts_tdas\data\20189 01 Static\NHTSA\UDS\20189 01 STATIC_UDS.004

The paths are there when coming out of TABLE but not created or stored in sFile.zip

Adam
03-21-2005, 09:51 AM
DarrellBlack,

I can replicate this issue. It appears as though the Zip.Add action is not preserving the paths that are used to create it. I will log this for the developers to look into.

Adam Kapilik

DarrellBlack
03-21-2005, 11:50 AM
Adam, thank you for the quick reply. I will be standing by for hopfully a patch or updated plugin. Would this come by a update (true update) or do I have to watch a forum for plugin updates?

Adam
03-21-2005, 12:30 PM
This would be in a service release.

Adam Kapilik

SUF6NEWBIE
03-21-2005, 07:10 PM
Have you tried this method..

sFolder = the action-s to get it
if sFolder then
Zip.Add(your final destination", {sFolder.."\\*.*"}, true, "my secret password", 9, nil, true);
end


(..less lines of code and zip action treats it as a table)