Zip file using program C

Is it possible to archive the file using the C program without using any external application (for example, Zip ..)?

+4
source share
3 answers

Of course, try using zlib . Or other libraries for compression. You can also code the compression algorithm yourself, but it can be too time consuming. Since you did not indicate why you need it, I cannot give you a better answer.

+11
source

Please find the link for some available compression libraries. It depends on the system you are using and the features you want. Zlib is the one I would recommend due to customizable features and user guides.

+2
source

You checked 7-zip. It has a full SDK, with sample sources and great functionality. This is open source and free :) Take a look here

Nice shell around SevenZipSharp . Using an example:

SevenZipCompressor compressor; compressor = new SevenZipCompressor(); compressor.CompressionLevel = CompressionLevel.Ultra; compressor.CompressionMethod = CompressionMethod.Lzma; compressor.CompressionMode = CompressionMode.Create; compressor.CompressFiles(archiveName, files2Add.ToArray()); 
0
source

Source: https://habr.com/ru/post/1315621/


All Articles