From 8224b617aee82379d5bbbcb8285d28814aea32bd Mon Sep 17 00:00:00 2001 From: martinahansen Date: Tue, 18 Mar 2014 16:21:34 +0000 Subject: [PATCH] added file check git-svn-id: http://biopieces.googlecode.com/svn/trunk@2294 74ccb610-7750-0410-82ae-013aeee3265d --- code_ruby/lib/maasha/filesys.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.39.2