如何检查chm文件中是否存在子文件? [英] How to check if a subfile exists in a chm file?
问题描述
我有许多CHM文件,每个文件都是5个不同HTML文件的压缩html.我的意思是,可以说我有5个不同的文件,分别命名为Alpha,Beta,Gamma,Delta,Theta. 说,我将这5个压缩到CHM文件中.让我们将该文件称为CompressedHtm.CHM.我有500多个这些文件. 现在,我要检查所有> 500个文件是否全部具有5个子文件(即Alpha,Beta,Gamma,Delta,Theta).有没有一种方法可以在VC ++ 6.0/MFC中进行检查而无需反编译CHM文件.
I have a number of CHM files, and each of the files is a comressed html for 5 different Html files. I mean, lets say I have 5 different files named Alpha, Beta, Gamma, Delta, Theta. Say, I compress these 5 in a CHM file. Lets call that file CompressedHtm.CHM. I have >500 of these files. Now I want to check if all of these >500 files have all 5 subfiles( i.e. Alpha, Beta, Gamma, Delta, Theta). Is there a way to check that in VC++ 6.0 /MFC without decomiling the CHM files.?
推荐答案
Free Pascal附带了一个完全独立的(*)命令行可执行文件CHMLS,它允许列出CHM文件的内容.它存在于多个平台上.
With Free Pascal comes a totally standalone(*) command line executable CHMLS that allows to list the contents of a CHM file. It exists for multiple platforms.
您可以使用管道执行该操作,然后处理输出.
You could execute that using pipes and then process the output.
几天前,我碰巧将exe文件压缩了几下,您可以在此处下载 http://www.stack.nl/~marcov/chmls.zip
I happen to zip the exes for sb else a few days back, you can get them here http://www.stack.nl/~marcov/chmls.zip
(如果您不信任我,也可以下载fpc 2.4.0 Windows版本)
(or download the fpc 2.4.0 windows release if you don't trust me)
(*)我不知道win9x上的状态.
(*) I don't know the state on win9x.
输出如下:
<Section> <Offset> <UnCompSize> <Name>
0 0 0 /#ITBITS
1 27737212 192334 /#STRINGS
0 70 133 /#SYSTEM
1 22414493 169080 /#TOCIDX
1 26847375 339904 /#TOPICS
1 27187279 294757 /#URLSTR
1 27482036 255176 /#URLTBL
1 27929546 1174749 /$FIftiMain
1 22411742 2751 /$OBJINST
0 0 0 /$WWKeywordLinks/
1 24122411 628812 /$WWKeywordLinks/BTree
1 24751223 111371 /$WWKeywordLinks/Data
1 24862594 2378 /$WWKeywordLinks/Map
1 24864972 1 /$WWKeywordLinks/Property
0 0 70 /_#_README_#_
0 0 0 /baseunix/
1 10656150 1395 /baseunix/_stat_ver.html
1 10651853 1438 /baseunix/_stat_ver_kernel.html
1 10654717 1433 /baseunix/_stat_ver_linux.html
1 10650407 1446 /baseunix/_stat_ver_linux_old.html
1 10653291 1426 /baseunix/_stat_ver_svr4.html
1 10452426 1438 /baseunix/arg_max.html
1 10644473 1510 /baseunix/bitsinword.html
以#和$开头的文件是内部文件.
The files starting with # and $ are internal files.
(这些工具是Free Pascal的CHM库随附的实用程序,该库支持CHM读/写支持,独立于Free Pascals文档和帮助系统的其他工具.它独立于OS,据我所知,它在OS X/PowerPC64
(the tools are utils that come with Free Pascal's CHM library which supports CHM read/write support independant of other tools for Free Pascals documentation and help systems. It's OS independant, and to my best knowledge it works fine on OS X/PowerPC64
这篇关于如何检查chm文件中是否存在子文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!