How to compress a Folder uses lzma sdk?

最后都变了- 提交于 2019-12-06 04:22:45
Arnaud Bouchez

You'll have to create a .7z archive, then include all files of the folder within. There is no direct "folder" compression: just compression of files. If you store a (relative) folder name within the file name (e.g. 'FolderName\FileName'), the folder 'FolderName' will appear within the archive.

You have within the SDK a ANSI-C compatible source code for 7z decompression with example. You'll have to adapt it to add all files of the folder to the archive (using FindFirst / FindNext / FindClose and recursion if you want the sub-folder to be included).

Edit: In fact, there is no .7z writing in the sdk. Only opening/extraction from a .7z archive within the sdk. You'll have to code it by hand... So perhaps the Using 7-Zip from Delphi? answer will help you here.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!