Created
April 29, 2011 18:10
-
-
Save tmaeda/948740 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'zlib' | |
require 'rexml/document' | |
File.open("CONTENT.tda") do |zipped_f| | |
File.open("CONTENT.tda.tdz", "r") do |index_f| | |
while record = index_f.read(8) | |
size = record.unpack("V*")[1] | |
puts size | |
z_content = zipped_f.read(size) | |
content = Zlib::Inflate.inflate(z_content) | |
puts "########################################" | |
content.split(/\0+/).each do |chunk| | |
begin | |
doc = REXML::Document.new chunk | |
doc.write(STDOUT, 2) | |
rescue | |
puts chunk | |
end | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
topic_maps.skn: なんかバイナリが入ってるな | |
fs.skn: 辞書内容っぽい | |
topic.skn: よくわからん。テキストなんだけど、fs.sknに比べると情報が少ない気がする。 | |
extras.skn: なんか.psのような.pdfのようなデータが入ってる | |
help.skn: 名前の通りヘルプっぽい |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
but where does this file go? i mean output