AddPackDirectory question
Posted: Sun Jun 02, 2024 9:22 pm
I can call AddPackDirectory to add an empty directory, but I don't understand how to add files to that packed directory.
Any thoughts?
TIA,
Russ
Any thoughts?
TIA,
Russ
http://www.purebasic.com
https://www.purebasic.fr/english/
RSrole wrote: It seems that the packer doesn't like the full path, meaning the drive letter x:\ and it also wants '/' instead of '\' for the packed name/path. Probably a unix thing. Perhaps someone more knowledgeable in this area can elaborate.
Code: Select all
UseZipPacker()
zipfile.s=GetTemporaryDirectory()+"temp.zip"
SourceDir.s=#PB_Compiler_Home+"Examples\Sources\Data\"
zp = CreatePack(#PB_Any, zipfile)
If zp
AddPackFile(zp,SourceDir+"AlphaChannel.bmp","AlphaChannel.bmp") ; Root
AddPackFile(zp,SourceDir+"Background.bmp","Temp\Background.bmp") ; Unexisting path
AddPackDirectory(zp,"Temp\Temp")
AddPackFile(zp,#PB_Compiler_Home+"Examples\Sources\Data\PureBasic.bmp","Temp\Temp\PureBasic.bmp") ; Just created path
ClosePack(zp)
EndIf