Code test
Code : Tout sélectionner
Define ZipfileName.s = "test.zip"
Define FileName.s = #PB_Compiler_Home + "Examples/3d/Data/Textures/caisse.png"
UseZipPacker()
; Création d'un fichier compressé vide
If CreatePack(0, ZipfileName, #PB_PackerPlugin_Zip)
ClosePack(0)
EndIf
; Ajout de fichier
;If OpenPack(0, ZipfileName, #PB_PackerPlugin_Zip)
If CreatePack(0, ZipfileName, #PB_PackerPlugin_Zip)
AddPackFile(0, FileName, GetFilePart(FileName))
ClosePack(0)
Else
Debug "oops erreur ouverture"
EndIf
; Vérification
If OpenPack(0, ZipfileName)
If ExaminePack(0)
While NextPackEntry(0)
Debug "Name: " + PackEntryName(0) + ", Size: " + PackEntrySize(0)
Wend
EndIf
ClosePack(0)
EndIf