]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/lib/maasha/filesys.rb
added file check
[biopieces.git] / code_ruby / lib / maasha / filesys.rb
index 6a990fa8b2cc67e85f576de1b8deaf088e6eb8f8..ff5c4eff0f538ba7a7201179121f063c2bdb5124 100644 (file)
@@ -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