Skip to content

Instantly share code, notes, and snippets.

require 'zlib'
filename = 'CONTENT'
#filename = 'NAME'
#filename = 'TITLE'
data = []
open(filename + '.tda.tdz', 'rb') do |idx|
open(filename + '.tda', 'rb') do |dat|
until idx.eof?
pre_size, post_size = idx.read(8).unpack('V*')
#!/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]