Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » ZCompress question
ZCompress question [message #12572] Fri, 09 November 2007 12:22 Go to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

Hello!
How to use ZCompress and ZDecompress functions.
Is there possibility to compress files and folder!

Please post a small example.
Thanks!!!
Re: ZCompress question [message #12628 is a reply to message #12572] Sun, 11 November 2007 18:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
malya wrote on Fri, 09 November 2007 06:22

Hello!
How to use ZCompress and ZDecompress functions.
Is there possibility to compress files and folder!

Please post a small example.
Thanks!!!



Yes, but do not expect it to result in .zip (or anything) compatible format.

The most simple way to compress single file is something like

SaveFile("file.compressed", ZCompress(LoadFile("file")));

Mirek
Re: ZCompress question [message #12633 is a reply to message #12572] Sun, 11 November 2007 20:08 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

Thanks for you and for your job!
Re: ZCompress question [message #12857 is a reply to message #12572] Thu, 22 November 2007 09:13 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

Hello!
Sorry for my English.
I have a new question.
Is there an exapmple or wrapper for archiving.
I seek, but not find!
Thanks!
Re: ZCompress question [message #12874 is a reply to message #12857] Fri, 23 November 2007 23:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
"archiving" is a wide term...

Mirek
Re: ZCompress question [message #12880 is a reply to message #12874] Sat, 24 November 2007 14:07 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

I want create a ZIP archive.
Re: ZCompress question [message #12898 is a reply to message #12880] Mon, 26 November 2007 22:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
malya wrote on Sat, 24 November 2007 08:07

I want create a ZIP archive.



That is not directly supported by U++.

Mirek
Re: ZCompress question [message #12903 is a reply to message #12572] Tue, 27 November 2007 09:52 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
But the 7zip library is included with uppsrc I think?

That one should be well capable to produce "7z" archives for sure, maybe even zip? (wouldn't that brake some patents?)

Now I see that's only the LZMA compression method library.
To get full 7-zip format you would probably need to mix it with the source of 7-zip itself ( http://sourceforge.net/projects/sevenzip/ ).
Both library and 7-zip are released also under (L)GPL, so if you are not working on closed source, you can go this way.
But you will still need some time to check the sources of both and copy the needed source into your project.

I'm not sure about "zip", what to do. You should probably call some external packer like 7zip or pkzip with list of files to add archive? That way you will need to deal only with the preparation of files and error handling, but no compression code itself.
It may be a bit more difficult to install your app (either it will require additional install of some supported zip packer, or you will have to deal with licenses to be able to include one of them directly with your application), but it should be much easier to develop it.

Also as long as you don't plan to distribute your application (planning it to use for your personal use only), you may use GPL code in any way you wish without having ever to distribute source or worry about licenses in any way.

@Mirek: hmm.. haven't been 7z LZMA lib under BSD license before?
Weird, I think so. But now it is LGPL with exception that you may link any license code to it as long as you don't modify original LZMA library in any way.
Re: ZCompress question [message #12914 is a reply to message #12903] Tue, 27 November 2007 23:13 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mr_ped wrote on Tue, 27 November 2007 03:52

But the 7zip library is included with uppsrc I think?



No. The only use of 7z now is for Win32 U++ installer. In that case, everything is packed using 7z commandline and unpackaged by installer, using the 7z code. If I remember well, 7z unpacker is public domain (but even if it would not, I would be happy to provide installer's sources Wink.

Mirek
Previous Topic: setting include-path
Next Topic: 126 errors when I try to compile my application
Goto Forum:
  


Current Time: Fri Apr 19 05:04:37 CEST 2024

Total time taken to generate the page: 0.04763 seconds