Crystar::Reader
Reads tar file entries sequentially from an IO.
Example
require "tar"
File.open("./file.tar") do |file|
Crystar::Reader.open(file) do |tar|
tar.each_entry do |entry|
p entry.name
p entry.file?
p entry.dir?
p entry.io.gets_to_end
end
end
end
Constructors
Class methods
Instance methods
next_entry
next_entry advances to the next entry in the tar archive. The Header#size determines how many bytes can be read for the next file. Any remaining data in the current file is automatically discarded.
EOF is returned at the end of the input. ameba:disable Metrics/CyclomaticComplexity