Page 1 of 1

CreatePack, add folder?

Posted: Wed Aug 07, 2013 10:03 pm
by IdeasVacuum
WinXP SP3 x86

In PB5.11, I find I cannot Create a Pack File using a full path for the pack file name:

Code: Select all

UseZipPacker()
sPath = "C:\Documents and Settings\User01\Application Data\CADM 2013 A01"
If CreatePack(#ZipZW3D, sPath + ".zip")
....the solution in PB5.11 was to first SetCurrentDirectory() and then pass a name only for the pack file.

PB5.20Beta8 accepts the full path as above without flinching :wink:

However, what I wanted to do was pack a folder of files, but that fails in PB5.11 and 5.20Beta8. Yes, I could enumerate the folder and pack all the files, but on unpacking with WinZip or other app, the folder would not be created? Not an issue if it's my app doing the unpacking of course, but that is not always the case.

I think that UseZipPacker() is probably a poor choice for my purposes anyway, because the verbatim zip standard does not fully support Unicode file names. I usually exchange files across the globe using 7-Zip. Better search the forum for 7z file solutions......

Edit: Another hiccup - what if the folder to be packed contains sub-folders?
Edit2: There is a stand-alone command line version of 7-Zip. Looks to have potential.

Re: CreatePack, add folder?

Posted: Wed Aug 14, 2013 5:25 am
by JHPJHP
Windows 7 - 64bit
Windows XP - 32bit

PureBasic v5.20 Beta 9

Hi,

I was having the same problem with full paths in PB 5.20 Beta 9, but after some testing I found that I was able to create a Pack File using the full path, as long as I did the following:
- AddPackFile (at least one)
- Use Delay before ClosePack

I could also add a folder using this naming convention: "test\test.txt"

Code: Select all

UseZipPacker()
sPath.s = "C:\Users\Administrator\Desktop\New Pack.zip"

If CreatePack(0, sPath)
  AddPackFile(0, "C:\Users\Administrator\Desktop\test.txt", "test\test.txt")
  Delay(100)
  ClosePack(0)
EndIf
Maybe this works for PureBasic v5.11?

Re: CreatePack, add folder?

Posted: Wed Aug 14, 2013 3:36 pm
by IdeasVacuum
It probably does work with a bit of extra effort but I have since found z7 to be superior for my needs anyway.