]> git.donarmstrong.com Git - biopieces.git/commitdiff
exchanged zlib code with commandline gzip
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 7 Oct 2013 12:13:26 +0000 (12:13 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 7 Oct 2013 12:13:26 +0000 (12:13 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@2225 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/lib/maasha/filesys.rb

index cee9e2213f9fef8766206b7a5b32f130620d8f18..81190f532d6ee54281d85d923168e5fd703c51fe 100644 (file)
@@ -22,7 +22,7 @@
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
-require 'zlib'
+require 'zlib'
 # require 'bzip2'
 require 'open3'
 
@@ -50,7 +50,8 @@ class Filesys
     if mode == 'w'
       case options[:compress]
       when :gzip
-        ios = Zlib::GzipWriter.new File.open(file, mode, options)
+        # ios = Zlib::GzipWriter.new File.open(file, mode, options)
+        ios, = Open3.pipeline_w("gzip -f", out: file)
       when :bzip, :bzip2
         # ios = Bzip2::Writer.new File.open(file, mode, options)   # TODO being pissed with buggy bzip2 gem.
         ios, = Open3.pipeline_w("bzip2 -c", out: file)
@@ -63,7 +64,8 @@ class Filesys
       else
         case `file -L #{file}`
         when /gzip/
-          ios = Zlib::GzipReader.new File.open(file, mode, options)
+          # ios = Zlib::GzipReader.new File.open(file, mode, options)
+          ios = IO.popen("zcat #{file}")
         when /bzip/
           # ios = Bzip2::Reader.new File.open(file, mode, options)   # TODO this method is buggy, investigate
           ios = IO.popen("bzcat #{file}")