I understand. What I want is an option that limit the total output size to a specified size. Since it is not possible to really limit the output to the exact specified size, I decided to use the temp files, understandind that it is an approximation and that the final output will be either smaller or larger (I've seen both in my tests).

Is there a better way to do that or does the actual implementation works for you?

Thanks