X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=code_ruby%2Flib%2Fmaasha%2Ffilesys.rb;h=ff5c4eff0f538ba7a7201179121f063c2bdb5124;hb=8224b617aee82379d5bbbcb8285d28814aea32bd;hp=6a990fa8b2cc67e85f576de1b8deaf088e6eb8f8;hpb=eb99c8692714ae906908545a7ff8f59f0d9575e9;p=biopieces.git diff --git a/code_ruby/lib/maasha/filesys.rb b/code_ruby/lib/maasha/filesys.rb index 6a990fa..ff5c4ef 100644 --- a/code_ruby/lib/maasha/filesys.rb +++ b/code_ruby/lib/maasha/filesys.rb @@ -60,11 +60,14 @@ class Filesys else case `file -L #{file}` when /gzip/ - ios = IO.popen("gzip -cd #{file}") + puts "GZIP" + ios = IO.popen("gzip -cd #{file}", :external_encoding=>"EUC-JP") when /bzip/ ios = IO.popen("bzcat #{file}") - else + when /ASCII/ ios = File.open(file, mode, options) + else + raise "Unknown file type: #{`file -L #{file}`}" end end end