addpackfile after openpack not working in 5.42

Just starting out? Need help? Post your questions and find answers here.
Poltergeist
User
User
Posts: 26
Joined: Fri Jul 14, 2006 10:27 pm

addpackfile after openpack not working in 5.42

Post by Poltergeist »

Code: Select all

UseZipPacker()
Debug CreatePack(0,"c:\temp\test.zip")
Debug AddPackFile(0,"c:\temp\unpacked\Tobbe 2.lic","Tobbe 2.lic")
Debug ClosePack(0)
Debug OpenPack(0,"c:\temp\test.zip")
Debug AddPackFile(0,"c:\temp\unpacked\Tobbe 2.vbs","Tobbe 2.vbs")
ClosePack(0)
After creating a zipfile using createpack(), I sometimes do have the need to add an extra file. For that, I use openpack(), and then addfilepack. At least, untill PB version 5.31. I just downloaded the latest 5.42 version, and then it does not work anymore. I can create a pack, add multiple files to it, close the file. After opening the file (with OpenPack), the AddPackFile function returns a 0, and the file is not added into the zip file.
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: addpackfile after openpack not working in 5.42

Post by collectordave »

Similar problem?

Trying to add files to an archive.

Take a look at this thread http://www.purebasic.fr/english/viewtop ... 13&t=63654

It unpacks then adds files etc the repacks.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Poltergeist
User
User
Posts: 26
Joined: Fri Jul 14, 2006 10:27 pm

Re: addpackfile after openpack not working in 5.42

Post by Poltergeist »

Ofcourse that would work, but it's a workaround for something that used to work.

Tested some more. In 5.40, the addpackfile after the openpack gives a [ERROR] Invalid memory access. (read error at address 0)
In 5.42, the same command just returns a zero.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: addpackfile after openpack not working in 5.42

Post by walbus »

You must delete the pack and write complete new
Hold the entries in a list, so you can write again the pack
This is not a bug in 542
Post Reply