如何使用lzma sdk压缩文件夹? [英] How to compress a Folder uses lzma sdk?
问题描述
http://www.7-zip.org/sdk.html
我可以用它来压缩文件,但是找不到压缩文件夹的功能
http://www.7-zip.org/sdk.html
I can uses it compress a file, but can not find function of compress a Folder
推荐答案
您必须创建一个 .7z
存档,然后在其中包含该文件夹的所有文件。没有直接的文件夹压缩:只有文件压缩。如果在文件名中存储(相对)文件夹名(例如 FolderName\FileName),则文件夹 FolderName将出现在存档中。
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.
您SDK中包含用于7z解压缩的ANSI-C兼容源代码,并带有示例。
必须对其进行修改,以将文件夹的所有文件添加到存档中(使用 FindFirst / FindNext / FindClose
并递归(如果需要子文件夹)
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).
编辑:实际上,SDK中没有.7z文字。只能从sdk中的.7z存档中打开/提取。您必须手工编写代码...所以也许使用Delphi的7-Zip吗? 答案会在这里为您提供帮助。
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.
这篇关于如何使用lzma sdk压缩文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!