Page 1 of 1

PackMemory + PackerCallback

Posted: Thu Jul 24, 2003 8:43 pm
by Tomio
Hello,

I have a program to pack files.
99% of the files are beeing packed within a reasonable time.
The packer / unpacker work good.

But there is always a file which cannot be packed.
My program takes 5-10 minutes to continue with PackMemory result = 0.

I inserted the PackerCallback planning to program some simple algorithm which stops the packer in case of beeing too slow.

But to my surprise, in these situations the PackerCallback also is not called. The docu says: "The time between two call isn't user definable, it will be calculated automatically." But the routine sleeps.

Does someone have an idea how to abort the packer?

Thank's../tomio

Added: There is at least one file, 200KB size, where the Callback won't do anything more after 26% of SourceMemory.
../tomio

Posted: Fri Jul 25, 2003 7:08 am
by Fred
Try to put the compression level to 8 (I'm testing this).

Posted: Fri Jul 25, 2003 5:56 pm
by Tomio
Fred wrote:Try to put the compression level to 8 (I'm testing this).
With 8 it works. The same speed I'm used to see with 0.
Hmm, I never tried numbers higher 0, because the 0-compression is good enough for my needs and I expected higher values to be slower.

My tests with one file gives:

0, 2 bad
1, 8 good

From time to time I need to compress many files (~200). This is done in a loop. But it's bad if the loop stops somewhere in between. That's why for me it's important to have a callback which is not blocked.

Do you think you can solve it? Or do you think compression ratio 1/8 will do this?
../tomio

Posted: Sat Jul 26, 2003 1:57 pm
by Fred
Yes, it should be a problem with internal buffer. I will fix it, thanks.