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
--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