You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use bzip2-ruby to stream-in .tar.bz2 files via Gem::Package::TarReader.
BRIEF: It doesn't work yet due to this:
NoMethodError: undefined method `pos' for #<Bzip2::Reader:0xaa2bf5c>
Details follow.
require "bzip2-ruby"
require "rubygems/package"
#fn = "/path/to/file.tar"
fn = "/path/to/file.tar.bz2"
#fn = "/path/to/file.tar.gz"
stream = if fn.match /\.bz2\z/
Bzip2::Reader.open(fn)
elsif fn.match /\.gz\z/
Zlib::GzipReader.open(fn)
elsif fn.match /\.tar\z/
File.open(fn)
else
raise "Error: Don't know how to handle '#{fn}', aborting"
end
untar = Gem::Package::TarReader.new(stream)
untar.each do |entry|
...
end
Plain tar and .tar.gz work. .tar.bz2 doesn't, here's the exception info:
NoMethodError: undefined method `pos' for #<Bzip2::Reader:0xaad6394>
from /home/rbdev/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_reader.rb:42:in `initialize'
from /home/rbdev/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_reader.rb:23:in `new'
from /home/rbdev/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_reader.rb:23:in `new'
Thank you.
Alex
The text was updated successfully, but these errors were encountered:
Hi
I'm trying to use
bzip2-ruby
to stream-in.tar.bz2
files viaGem::Package::TarReader
.BRIEF: It doesn't work yet due to this:
Details follow.
Plain
tar
and.tar.gz
work..tar.bz2
doesn't, here's the exception info:Thank you.
Alex
The text was updated successfully, but these errors were encountered: