Page 1 of 1

CreatePack fault for Tar pack. Manual issue?

Posted: Thu Jan 30, 2025 6:49 pm
by Psychophanta
If a 'CreatePack(0,file$,#PB_PackerPlugin_Tar,9)' is used, then it does not compress, it onli does with '#PB_PackerPlugin_Tar|#PB_Packer_Gzip' or '#PB_PackerPlugin_Tar|#PB_Packer_Bzip2' flags.
I guess it is a fault in the manual which says:
#PB_PackerPlugin_Tar : use the Tar packer to create the pack file. UseTarPacker() has to be called to register the plugin.
It can be combined with #PB_Packer_Gzip or #PB_Packer_Bzip2 to create compressed tar archive.
Looks like the 'can' word must be 'must'.

Besides of it, even used with some of the correct flags, the function UncompressMemory() returns 0 after being compressed the memory with the same flags.

Re: CreatePack fault for Tar pack. Manual issue?

Posted: Thu Jan 30, 2025 10:19 pm
by infratec
A tar file is not compressed :wink:

If you use

Code: Select all

tar -cf test.tar /home/
you get a normal tar file without compression.

If you want a gzipped compressed tar archive you need

Code: Select all

tar -czf test.tgz /home/
tgz is short for tar.gz

if you want a bzip2 compressed tar archive you need

Code: Select all

tar -cjf test.tbz /home/
tbz is short for tar.bz2

So 'can' is correct.

Re: CreatePack fault for Tar pack. Manual issue?

Posted: Fri Jan 31, 2025 9:18 am
by Psychophanta
Thanks. Will see if it works as expected :)
But why the hell there is not available a function CompressMemory() for Tar ?
I've got to rack my brains to do something that does it, workarounds. :? :x