--[[ Function: Zip.AddFile Purpose: Adds a file (or multiple files if you use a mask) to a Zip file by filename instead of using a table to specify filenames Arguments: Same as Zip.Add except that the second argument (FileToAdd) is a filename instead of a table. Returns: Nothing. Sets same error codes as Zip.Add. Examples: Zip.AddFile("C:\\Temp\\MyArchive.zip","C:\\Temp\\File.exe"); Zip.AddFile("C:\\Temp\\MyArchive.zip","C:\\Temp\\*.exe",true,"",5,true); ]] function Zip.AddFile(ZipFile,FileToAdd,IncludeFolderNames,Password,CompFactor,CallbackFunction,Recurse) tblFiles = {FileToAdd}; if(type(IncludeFolderNames) == "nil")then IncludeFolderNames = true; end if(type(Password) == "nil")then Password = ""; end if(type(CompFactor) == "nil")then CompFactor = 5; end if(type(Recurse) == "nil")then Recurse = false; end Zip.Add(ZipFile,tblFiles,IncludeFolderNames,Password,CompFactor,CallbackFunction,Recurse); end --[[ Function: Zip.AddFolderTree Purpose: Adds an entire folder tree (a folder, the files it contains and all files in all subfolders. Arguments: Same as Zip.Add except that the second argument (BaseFolder) is a folder path instead of a table and the IncludeFolderNames and Recurse arguments are not passed in (they are set automatically) Returns: Nothing. Sets same error codes as Zip.Add. Examples: Zip.AddFolderTree("C:\\Temp\\MyArchive.zip","C:\\MyDataFolder"); ]] function Zip.AddFolderTree(ZipFile,BaseFolder,Password,CompFactor,CallbackFunction) strFileSpec = BaseFolder; String.TrimRight(strFileSpec,"\\"); strFileSpec = strFileSpec.."\\*.*"; tblFiles = {strFileSpec}; if(type(Password) == "nil")then Password = ""; end if(type(CompFactor) == "nil")then CompFactor = 5; end Zip.Add(ZipFile,tblFiles,true,Password,CompFactor,CallbackFunction,true); end