CreatePack, add folder?

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

CreatePack, add folder?

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
JHPJHP
Addict
Addict
Posts: 2273
Joined: Sat Oct 09, 2010 3:47 am

Re: CreatePack, add folder?

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

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: CreatePack, add folder?

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply