|
I want a progress show during compression, how can I do? May be some function I don't know? Can I solve this question with "Createpipe",but how to do?
maybe someone tell me?
Thanks a lot in advance!
|
|
|
|
|
I really like this application/xzip/xunzip but I think it does not work on Linux. Is there a similar program that does work on linux???
|
|
|
|
|
I know the GUI wont but will the Zip and Unzip functionality work in linux as only a console app? I will try this out tomorrow but if it doesnt I will stop.
Why cant people get along with penguins
|
|
|
|
|
Seems that I'm too stupid to figure it out myself...
How do I set the desired compression level?
Please help, it's kinda urgent...
|
|
|
|
|
The compression level (or ratio) is determined by the configuration_table, which you can see at line 365 of XZip.cpp:
const config configuration_table[10] = {
{0, 0, 0, 0},
{4, 4, 8, 4},
{4, 5, 16, 8},
{4, 6, 32, 32},
{4, 4, 16, 16},
{8, 16, 32, 32},
{8, 16, 128, 128},
{8, 32, 128, 256},
{32, 128, 258, 1024},
{32, 258, 258, 4096}};
There is some explanation of the four values at line 563:
unsigned max_chain_length;
unsigned int max_lazy_match;
unsigned good_match;
int nice_match;
At line 1533 you will find the function lm_init() :
void lm_init (TState &state, int pack_level, ush *flags)
and at line 1556 in lm_init() :
state.ds.max_lazy_match = configuration_table[pack_level].max_lazy;
state.ds.good_match = configuration_table[pack_level].good_length;
state.ds.nice_match = configuration_table[pack_level].nice_length;
state.ds.max_chain_length = configuration_table[pack_level].max_chain;
So your question is answered by finding what the value of pack_level is. At line 2551, we see that lm_init() gets called:
lm_init(state,state.level, &zfi->flg);
and previously state is set up at line 2542:
state.param=this; state.level=8; state.seekable=iseekable; state.err=NULL;
So the answer seems to be 8, the next-to-highest compression level. (There is no external way to change the value of 8, so you will have to implement your own function if you want to do this.) The code does not seem to want to accept level 9, since at line 1537 we see:
Assert(state,pack_level>=1 && pack_level<=8,"bad pack level");
If you do change the compression level, I strongly urge you to test it thoroughly. I have not done much testing in this area myself.
Best wishes,
Hans
|
|
|
|
|
Hey, great, I found the configuration_table myself, but I didn't expect that such an important value would be buried that deep in the code...
Be sure that it gets tested.... alot...
Thanks for your help...
So long
Tom
|
|
|
|
|
Great code.
Perhaps I've missed something but it appears that there is no way to add files to an existing zip, or is there? If not, that would be a great addition.
|
|
|
|
|
HI,
did you solve this problem? I am unable to do it, please let us know if you have succeeded in doing so.
Thanks in advance.
|
|
|
|
|
Hello!
It looks like you know what you are doing, so I want to ask you if you have any clue about how to create a program that compress and compound some files into one single .exe file like a single .exe file setup application?
/ Deeply impressed!
|
|
|
|
|
I have not tried this, but here is something: http://www.codeproject.com/file/self_extractor.asp
Best wishes,
Hans
|
|
|
|
|
That's easy, just store the size of the exe, add the compressed files to the end of the exe and as the last long write the start of the data.
|
|
|
|
|
Deeply,
You are asking about creating SelF-eXtracting executables (SFX). I have used this open-source MakeSFX program with great success. There is a GUI version and a command-line version. It shouldn't be hard to integrate the code into one's project.
|
|
|
|
|
Thank you guys!
That two links gave me what i wanted!
Big thanks!!!
|
|
|
|
|
This is great class, but will you implement feature to open password protected archive?
This will be great improvement.
You got my 5.
|
|
|
|
|
Vanja Bojic wrote:
will you implement feature to open password protected archive
Thank you for your interest. This is one of things I would like to do, too.
Best wishes,
Hans
|
|
|
|
|
I'm also impressed
But the current Zip methods for password protection of zip files is quite weak. If you can come up with a better way it would be great.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
Warning Link to the minion's animation, do not use.
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
Check Winzip 9 - they've improved the password mechanism, thus
breaking the ZIP format.
WinZip 9.0 supports 128- and 256-bit key AES encryption, which provide much greater cryptographic security than the traditional Zip 2.0 encryption method used in earlier versions of WinZip.
Details on this can be found here
http://www.winzip.com/whatsnew90.htm
and here
http://www.winzip.com/aes_info.htm
|
|
|
|
|
Hi Hans,
Maybe a stupid question but why did you save the project with the setting to 'Win32 Unicode Release' in the first place and not with setting to 'Win32 Release'?
Looks like you are introducing problems on purpose for compiler or OS without Unicode
Maybe It is just me ,
Michel Wassink
We must make user friendly software. Where are friendly users?
|
|
|
|
|
Michel Wassink wrote:
Looks like you are introducing problems on purpose for compiler or OS without Unicode
There is no compiler without unicode, neither is there an OS without it.
Michel Wassink wrote:
Maybe It is just me
Definitely
Off to Brazil in a few days
|
|
|
|
|
You don't get the point!;P
Default installation of VC++ does not include Unicode Libraries of MFC. If you try to compile this, without changing active config you get a warning.
Best is to include an example executable build as static release. so you don't need any mfc dll whatsoever on your comp. In case you have compiler installed you can always build the executable when it is set to 'Win32 Release'.
Do you think it is amusing if you are buying a pc with switch set to 110 Volt in your country and it starts to smoke?
Michel Wassink
We must make user friendly software. Where are friendly users?
|
|
|
|
|
Michel Wassink wrote:
does not include Unicode Libraries of MFC
Duh, beats me. I'd never think of this. "Default Installation" is something I never do and Unicode libraries are a must anyway.
Michel Wassink wrote:
Do you think it is amusing if you are buying a pc with switch set to 110 Volt in your country and it starts to smoke?
Mine didnt smoke. And the dealer took it back without asking. Whats the point?
Off to Brazil in a few days
|
|
|
|
|
There is no compiler without unicode
Borland Turbo C++ for DOS 3.0 is "without unicode."
neither is there an OS without it.
...and the reason is that DOS also has no unicode support. (seeing as Unicode was invented later)
Now you probably meant that compiler/OS is not the actual problem with regards to Unicode in this case, but then you knew that wasn't what the OP was talking about. If you're gonna be a prick, BE ACCURATE.
|
|
|
|
|
Anonymous wrote:
Borland Turbo C++ for DOS 3.0 is "without unicode."
...and the reason is that DOS also has no unicode support. (seeing as Unicode was invented later)
If it wasnt so easy to be dumb...
We are talking about Windows and compilers running on Windows as this is a Windows programming site. Anyway, maybe you didnt notice yet, but for the compiler Unicode means nothing else than using a short int instead of a char , this is something that even BTC++ 3.0 could do.
Off to Brazil in a few days
|
|
|
|
|
No wide-char strings and character constants or unicode filenames for source.
And I chose a DOS compiler because it was the most obvious, no doubt there are Windows compilers which are similarly lacking, but I can't name them off the top of my head. However, you broadened the scope yourself, saying that there were no compiler or OS.
|
|
|
|
|
Michel Wassink wrote:
why did you save the project with the setting to 'Win32 Unicode Release' in the first place and not with setting to 'Win32 Release'?
The order of configurations is out of my control. I do not like to distribute .opt and .ncb files for my projects, because many people have their own preferences and this would annoy them. When you delete .ncb and .opt files, Visual Studio uses its own algorithm to choose which configuration to make active. (Try this yourself: make "Release" configuration active, then save it, then delete .ncb and .opt files, then re-open.)
As you have seen, "Unicode Release" configuration is one opened. I think this is because it is last configuration I add to project - I'm guessing that last one is the default one. I suppose it would be possible to manually edit .dsp file, but this seems not too safe to me.
Maybe someone here on CP could create add-in to re-order configurations?
Hope this answers your question. Please email or post here if you have further questions.
Best wishes,
Hans
|
|
|
|
|