]> git.donarmstrong.com Git - biopieces.git/commitdiff
added file check
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 18 Mar 2014 16:21:34 +0000 (16:21 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 18 Mar 2014 16:21:34 +0000 (16:21 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@2294 74ccb610-7750-0410-82ae-013aeee3265d

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